Nginx reverse proxy causing 504 Gateway Timeout -


i using nginx reverse proxy takes requests proxy_pass actual web application upstream server running on port 8001.

if go mywebsite.com or wget, 504 gateway timeout after 60 seconds...however, if load mywebsite.com:8001, application loads expected!

so disallowing nginx communicate upstream server...

all started after hosting company reset machine stuff running on, prior no issues ever.

here's vhosts server block:

server {          listen   80;         server_name mywebsite.com;          root /home/user/public_html/mywebsite.com/public;          access_log /home/user/public_html/mywebsite.com/log/access.log upstreamlog;         error_log /home/user/public_html/mywebsite.com/log/error.log;          location / {                      proxy_pass http://xxx.xxx.xxx.xxx:8001;                     proxy_redirect off;                     proxy_set_header host $host;                     proxy_set_header x-real-ip $remote_addr;                     proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;                      }          }  

and output nginx error log:

2014/06/27 13:10:58 [error] 31406#0: *1 upstream timed out (110: connection timed out) while connecting upstream, client: xxx.xx.xxx.xxx, server: mywebsite.com, request: "get / http/1.1", upstream: "http://xxx.xxx.xxx.xxx:8001/", host: "mywebsite.com"

probably can add few more line increase timeout period upstream. examples below sets timeout 300 seconds :

proxy_connect_timeout       300; proxy_send_timeout          300; proxy_read_timeout          300; send_timeout                300; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -