简体   繁体   English

使用 google Compute Engine 和 nginx 部署 angular 7 应用程序-不显示任何内容

[英]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您也可以尝试按照以下步骤设置错误日志以进行调试

  1. sudo nano /etc/nginx/nginx.conf
  2. find the line error_log找到行 error_log
  3. change error level to debug logs/error.log debug ;将错误级别更改为 debug logs/error.log debug
  4. sudo service nginx restart

. .

尝试删除以 server_name 开头的行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Maven在Google App Engine上部署SpringBoot / Angular 4 - Deploy a SpringBoot / Angular 4 on Google App Engine with maven 如何在Google App Engine上部署Angular多语言应用程序 - How to deploy Angular multilanguage application on Google App Engine 将使用angular-cli创建的Angular4(Angular)部署到Google App Engine - Deploy Angular4 (Angular) created using angular-cli to Google App Engine 如何在 nginx 的容器下部署 Angular 应用程序? - How to deploy Angular app under container of nginx? 如何使用 CI-CD 流程将 Angular8 应用程序部署到谷歌应用引擎? - How to deploy an Angular8 application to google app engine using CI-CD process? 如何将 asp.net 核心(后端)和 angular 8(前端)应用程序一起部署到 Google App Engine? - How to deploy asp.net core (backend) and angular 8 (frontend) appplications together to Google App Engine? Angular 客户端无法访问 Google Compute Engine 中的 Localhost - Angular client cannot access Localhost in Google Compute Engine 将基本的Angular 2应用程序部署到Google App Engine - Deploying basic Angular 2 app to Google App Engine 将Angular 2应用程序部署到Google App Engine - Deploying Angular 2 app to Google App Engine Google App Engine上的Angular4和WebApp2 - Angular4 and WebApp2 on google App engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM