RadarURL
Skip to content
조회 수 1729 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

It is very common to see a 504 Gateway Time-out using Nginx webserver. This timeout error is generated often by a number of reasons on the backend connection that is serving content. To fix it, you will have to figure out what configuration are you using.

For Nginx + FastCGI (php-fpm), you should try to tweak nginx configuration in this way-:

Try raising max_execution_time setting in php.ini file (CentOS path is /etc/php.ini):

max_execution_time = 300

But, you should also change set request_terminate_timeout parameter (commented by default) at www.conf file from PHP-FPM:

pico -w /etc/php-fpm.d/www.conf

Then set the variable to the same value as max_execution_time:

request_terminate_timeout = 300

Now let’s add fastcgi_read_timeout variable inside our Nginx virtual host configuration:

location ~ .php$ {
root /var/www/sites/nginxtips.com;
try_files $uri =404;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}

Then restart nginx:

service nginx restart

For Nginx as Proxy for Apache web server, this is what you have to try:

Add this variables to nginx.conf file:

  proxy_connect_timeout       600;
  proxy_send_timeout          600;
  proxy_read_timeout          600;
  send_timeout                600;

Then restart nginx:

service nginx reload

Popular search terms:

 

출처 : http://www.nginxtips.com/504-gateway-time-out-using-nginx/

TAG •
?

List of Articles
번호 제목 글쓴이 날짜 조회 수
21 XpressEngine XE 1.5 캐시 사용으로 성능 극대화 JaeSoo 2012.05.09 4102
20 제로보드XE(Xpressengine) Anti-accessXE:기본설정 JaeSoo 2012.07.26 3922
19 Nginx 웹서버 성능분석 JaeSoo 2012.11.20 5734
18 강력한 웹서버 NGINX JaeSoo 2012.11.20 5069
17 NGINX 소개와 사용 현황 JaeSoo 2012.11.20 4819
16 Xpress engine nginx rewrite 설정, 짧은주소 (xpressengine) JaeSoo 2012.11.20 65780
15 Nginx 와 Apache 동시사용 설정 (영문) JaeSoo 2013.04.08 8866
14 Nginx HttpRewriteModule JaeSoo 2013.04.08 2794
13 nginx 에서 htaccess 사용하기 JaeSoo 2013.04.08 2874
12 NGINX서버를 통한 다운로드 링크 형성하기(POGOPLUG SERIES 4용) JaeSoo 2013.04.08 5302
11 nginx 재시작 배치파일 JaeSoo 2013.04.12 3211
10 아파치 2.4는 러시안 강호 NGINX를 넘을 수 있는가? JAESOO 2013.05.28 2792
9 Apache vs Nginx 성능을 밝혀라! JAESOO 2013.05.28 3637
8 Nginx 설치 (간략) JAESOO 2013.06.10 1694
7 Nginx에서 php 외에 추가로 여러 확장자를 처리 방법 JAESOO 2013.06.10 2902
6 Nginx SERverSETting JaeSoo 2014.04.07 1610
5 nginx 504 gateway time-out JaeSoo 2014.04.08 1540
4 Nginx Log에서 upstream timed out (110: Connection timed out) while reading response header from upstream JaeSoo 2014.04.08 1497
3 Nginx, FastCGI 지시어 및 설명 (504 Gateway Time-out 관련 설정 등) JaeSoo 2014.04.09 2220
» 504 Gateway Time-out using Nginx JaeSoo 2014.04.09 1729
Board Pagination Prev 1 2 Next
/ 2

PageViews   Today : 70 Yesterday : 2394 Total : 21713728  /  Counter Status   Today : 64 Yesterday : 1232 Total : 1142206

Edited by JAESOO

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소