我已经设置了一个 nginx 代理直通,它在 nginx 最初加载时工作正常,但最终(可能在一天左右之后?,此时不太确定)作为代理直通的位置仅返回504 GATEWAY_TIMEOUT响应。奇怪的是,我已经设置了多个 proxy_pass 位置,它是随机的,什么下降,什么保持不变。
这是nginx配置文件:
server {
listen 80;
server_name example.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /srv/www/frontend/current/;
location / {
try_files $uri $uri/ /index.html;
}
# Block all svn access
if ($request_uri ~* ^.*\.svn.*$) {
return 404;
}
# Block all git access
if ($request_uri ~* ^.*\.git.*$) {
return 404;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location /api/karma/ {
proxy_pass <server A>;
}
location /api/auth/ {
proxy_pass …Run Code Online (Sandbox Code Playgroud)