在google计算引擎上部署我的Range7应用程序并使用我的网站ip地址配置nginx之后,路由工作正常(我在地址栏中看到它.)但是屏幕上没有显示错误的502坏网关,请知道吗?
nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name COMPUTE_ENGINE_INSTANCE_EXTERNAL_IP;
location / {
root /home/path/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
proxy_pass "http://127.0.0.1:8080";
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
}
}发布于 2019-01-08 17:47:55
尝试这个sudo journalctl --follow _SYSTEMD_UNIT=nginx.service,看看当您发出请求时控制台中发生了什么。此外,您还可以尝试设置错误日志以调试以下步骤
sudo nano /etc/nginx/nginx.conflogs/error.log debug;sudo service nginx restart。
发布于 2019-01-17 13:15:24
尝试删除以server_name开头的行
https://stackoverflow.com/questions/54088604
复制相似问题