【发布时间】:2016-05-09 08:03:56
【问题描述】:
我在互联网上看到了几个例子,但尝试了它们都不起作用,你能告诉我在做什么错吗?我在 nginx 服务器上有我的 laravel 应用程序,现在我想在我的服务器上的不同端口上运行另一个 node.js 应用程序。我一直在尝试不同的方式,但我得到的只是“502 Bad Gateway”
另外注意,我的 HTTPS 端口允许端口 3000。
这是我的服务器配置代码-
server{
listen 443 ssl;
# listen [::]:80 ipv6only=on;
server_name node.example.com;
root /home/Tapos/node_modules;
index index.html index.htm index.js;
location / {
try_files $uri $uri/ =404;
# proxy_pass https://node.example.com;
proxy_pass https://localhost:3000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
【问题讨论】: