如何解决即使在Nginx.confNode.js中增加了超时之后,网关仍返回504
这是我的Nginx配置
server {
listen 4000 ssl;
ssl_certificate /opt/certs/test.crt;
ssl_certificate_key /opt/certs/test.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'sample';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
large_client_header_buffers 4 64k;
client_header_buffer_size 16k;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header "Cache-Control" "max-age=0,no-cache,no-store,must-revalidate";
add_header "Pragma" "no-cache";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "script-src 'unsafe-inline'";
location / {
proxy_pass https://127.0.0.1:4001;
proxy_set_header Host $http_host;
proxy_read_timeout 600s;
proxy_http_version 1.1;
}
}
server {
listen 4400 ssl;
ssl_certificate /opt/certs/sample.crt;
ssl_certificate_key /opt/certs/sample.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'sample';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
large_client_header_buffers 4 64k;
client_header_buffer_size 16k;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header "Cache-Control" "max-age=0,must-revalidate";
add_header "Pragma" "no-cache";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "script-src 'unsafe-inline'";
ssl_verify_client off;
location / {
proxy_pass https://127.0.0.1:4001;
proxy_set_header Host $http_host;
proxy_read_timeout 600s;
proxy_http_version 1.1;
}
}
}
该服务一直等待到超时,但是当通过网关命中时,它恰好在60秒后超时。 我试过设置send_timeout,keepalive_timeout等选项,但是没有任何效果。 有人可以告诉我Nginx.conf或NodeJS的任何设置中缺少的内容吗 谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。