我正在从事Angular 7项目。我已经开始ng服务,它正在http://localhost:4200上投放。标签设置为。
我已将nginx配置为反向代理,如下所示:
location / {
proxy_pass http://localhost:4200;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
导航到http://localhost
时,我得到一个空白页,并在控制台中看到以下消息:
Loading failed for the <script> with source “http://localhost/runtime.js”
Loading failed for the <script> with source “http://localhost/polyfills.js”
Loading failed for the <script> with source “http://localhost/styles.js”
Loading failed for the <script> with source “http://localhost/vendor.js”
Loading failed for the <script> with source “http://localhost/main.js”.
当我导航到http://localhost:4200
我在做什么错了?