'2020/09/08'에 해당되는 글 2건

  1. 2020/09/08 용비 nginx proxy_pass 502 response
  2. 2020/09/08 용비 Nginx Port Permission Denied on Cent OS 7

nginx proxy_pass 502 response

Articles 2020/09/08 21:49 용비
nginx를 reverse proxy로 사용하는 경우, 502 Bad Gateway Response가 발생하는 경우가 있다.

proxy_pass 설정이 제대로 되어 있고, proxy_set_header를 맞게 설정했을 경우는 SELinux 설정 문제이다.

다음과 같이 설정하여 문제를 해결한다.

# setsebool -P httpd_can_network_connect true

받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://www.yongbi.net/rss/response/873

Cent OS 7를 minimal로 설치하고 nginx 를 설치했다.
다른 VM에 Cent OS 7을 설치하고, mattermost를 설치했다.

reverse proxy 설정하기 위해서 8065 포트를 설정하고, nginx를 재기동했더니...
nginx가 실행되지 않는다.
/var/log/nginx/error.log를 살펴보니...

bind() to 0.0.0.0:8065 failed (13: Permission denied)
SElinux에서 8065 포트는 사용하지 못하도록 막혀 있어서 발생한 오류.

1. SELinux에서 오픈되어 있는 http port 확인하는 방법
# semanage port -l | grep http_port_t
        만약 semanage command를 사용할 수 없다는 메시지가 뜨면, 다음으로 라이브러리를 확인하여 설치한다.
# yum provides /usr/sbin/semanage
# yum install policycoreutils-python -y

2. 특정 포트를 오픈하기 위해 SELinux에 추가
# semanage port -a -t http_port_t -p tcp 8065
3. nginx 재기동



TAG
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://www.yongbi.net/rss/response/872