应用程序正在服务器中运行。但它无法从浏览器访问。
示例配置文件——
server {
listen [::]:80;
server_name ..;
access_log /var/log/..;
error_log /var/log/..;
location / {
proxy_pass http://localhost-app;
proxy_http_version 1.1;
proxy_read_timeout 150s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-HTTPS 0;
}
}
upstream localhost-app {
server 127.0.0.1:8081;
}
nginx版本:nginx/1.10.3
Ubuntu 16.04.3 LTS