![](/img/trans.png)
[英]Deploy a SpringBoot / Angular 4 on Google App Engine with maven
[英]Deploy angular 7 app with google Compute Engine and nginx - display nothing
在谷歌計算引擎上部署我的 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;
}
}
試試這個sudo journalctl --follow _SYSTEMD_UNIT=nginx.service
並查看當您發出請求時控制台中發生了什么。 您也可以嘗試按照以下步驟設置錯誤日志以進行調試
sudo nano /etc/nginx/nginx.conf
logs/error.log debug
;sudo service nginx restart
.
嘗試刪除以 server_name 開頭的行
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.