リクエストを受け取り、ポート 8001 で実行されているアップストリーム サーバーから実際の Web アプリケーションを取得するために proxy_pass を実行するリバース プロキシとして Nginx を使用しています。
mywebsite.com にアクセスするか、wget を実行すると、60 秒後に 504 Gateway Timeout が発生します...ただし、mywebsite.com:8001 をロードすると、アプリケーションは期待どおりにロードされます!
そのため、何かが Nginx とアップストリーム サーバーとの通信を妨げています。
これはすべて、ホスティング会社が私のものが実行されているマシンをリセットした後に始まりましたが、それ以前は問題はありませんでした。
これが私のvhostsサーバーブロックです:
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;
}
}
そして私のNginxエラーログからの出力:
2014/06/27 13:10:58 [error] 31406#0: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client: xxx.xx.xxx.xxx, server: mywebsite.com, request: "GET / HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:8001/", host: "mywebsite.com"