在此處輸入代碼我有一個映射有多個域的Web應用程序。其中一個域使用SSL,而另一個域則很簡單。 我試圖用NGINX和nodeJs。我的HTTPs響應非常慢。請查看conf文件並幫助我擺脫此問題。對於NodeJs應用程序,使用NGINX的https響應速度很慢
upstream myserver {
server 127.0.0.1:4502;
server 127.0.0.1:4500;
}
server {
listen 0.0.0.0:80;
server_name a.myserver.com;
access_log /var/log/nginx/nodetest.log;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://myserver/;
proxy_redirect off;
}
}
server {
listen 0.0.0:443;
server_name myapps.com;
access_log off;
ssl on;
ssl_certificate /mnt/drives/ssl_certificates/daffodilapps/ssl-bundle.crt;
ssl_certificate_key /mnt/drives/ssl_certificates/daffodilapps/ryans-key.pem;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://myserver/;
proxy_redirect off;
只是一個快速的,更改只監聽端口沒有0.0.0 *。可能與您的問題無關,仍值得一提。 – moka
你好,我有一個類似的問題:http://serverfault.com/questions/807420/nginx-and-apache-are-very-slow-as-reverse-proxy-for-nodejs-app-with-socket-io 您是否找到解決方案? 非常感謝 – vpx