JooTC
504 gateway timeout nginx

nginx 504 Gateway Time-out 에러 발생 시 대처 방법

504 gateway timeout nginx

nginx 504 Gateway Time-out 에러 해결 방법


nginx 504 Gateway Time-out 문제는 리버스 프록시응답이 지연되거나 서버 내 프록시 타임아웃으로 지정된 값을 초과할 경우에 발생합니다.

 

먼저 NginX 설정에서는 아래와 같이 해결하실 수 있습니다.

/etc/nginx/nginx.conf 파일(개별 서버의 config 파일 위치는 서버 마다 다를 수 있습니다.)을 수정합니다. location 블록 내에 아래와 같이 입력합니다.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
location / {
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
send_timeout 300;
}
location / { proxy_connect_timeout 300; proxy_send_timeout 300; proxy_read_timeout 300; send_timeout 300; }
location / {
    proxy_connect_timeout 300;
    proxy_send_timeout 300;
    proxy_read_timeout 300;
    send_timeout 300;
}

다음으로 php-fpm을 사용 중인 경우 /etc/nginx/fastcgi.conf 파일을 수정합니다. (fastcgi 관련 설정 파일이므로 서버 마다 파일명과 경로가 다를 수 있습니다.)

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
fastcgi_read_timeout 300;
fastcgi_read_timeout 300;
fastcgi_read_timeout 300;

 

위와 같이 설정을 적용하고 Nginx 서비스를 재시작해주시면 됩니다.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# service nginx restart (restart 또는 reload)
또는
# systemctl restart nginx (restart 또는 reload)
# service nginx restart (restart 또는 reload) 또는 # systemctl restart nginx (restart 또는 reload)
# service nginx restart (restart 또는 reload)
또는
# systemctl restart nginx (restart 또는 reload)

 

 

구독
알림
guest
5000


0 Comments
Inline Feedbacks
모든 댓글 보기
0
이 포스트에 대한 의견을 남겨주세요!x
error: 콘텐츠 무단 사용, 도용 사례로 인해 복사가 제한됩니다. 링크(URL)첨부를 사용해주세요. (소스코드는 복사할 수 있어요)