[英]Deploy angular 7 app with google Compute Engine and nginx - display nothing
after deploy my angular 7 app on google compute engine and configure nginx with my website ip address, the routing works fine (i see it in the address bar..) but nothing display on screen and get an error 502 Bad Gateway , please any idea?在谷歌计算引擎上部署我的 angular 7 应用程序并使用我的网站 IP 地址配置 nginx 后,路由工作正常(我在地址栏中看到它......)但屏幕上没有任何显示并收到错误502 Bad Gateway ,请知道?
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;
}
}
try this sudo journalctl --follow _SYSTEMD_UNIT=nginx.service
and see what's going in the console when you make a request.试试这个sudo journalctl --follow _SYSTEMD_UNIT=nginx.service
并查看当您发出请求时控制台中发生了什么。 Also you can try to set up the error logging to debug following these steps您也可以尝试按照以下步骤设置错误日志以进行调试
sudo nano /etc/nginx/nginx.conf
logs/error.log debug
;将错误级别更改为 debug logs/error.log debug
;sudo service nginx restart
. .
尝试删除以 server_name 开头的行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.