【发布时间】:2017-07-04 14:55:15
【问题描述】:
我已经阅读了部署文档以使用 NGINX 服务器部署 Angular 4 项目。但是当我使用 Angular 应用程序的路由重新加载时,会显示此错误:
http://www.mydomain.com.ec/swissecomer/myRoute
代码:“MethodNotAllowedError”
消息:“不允许 GET”
这是我的 nginx 服务器中的 conf 文件:
upstream proyectoWeb {
ip_hash;
server localhost:8087;
}
server {
listen 8088;
proxy_pass proyectoWeb;
server_name 200.31.25.34 192.168.5.27 www.mydomain.com localhost;
root /u01/servidores/;
location swissecomer/ {
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
access_log /var/log/nginx/access_log combined;
}
当我点击这些网址时,它显示的网页很好:
但是如果我点击下一个 url http://www.mydomain.com.ec/swissecomer ngix 服务器会继续加载,直到它在浏览器中显示超时错误。
感谢您的回复。
【问题讨论】: