繁体   English   中英

proxy_pass 不支持 # 在 nginx 中

[英]proxy_pass not support # in nginx

我是 nginx 的新手,我正在尝试创建干净的 URL 模式,如果我在浏览器"http://xx.xx.xx.xx:61001/employee"上使用下面的 URL,那么它应该路由到"http://localhost:8080/emp/#/details" 但不幸的是,我在浏览器上收到 404 错误。 即使我的应用程序已启动并正在运行。 #(特殊字符)在 nginx 中有一些问题。 有人可以在这里帮助我吗?

在我的配置下面:

location /employee {proxy_pass http://localhost:8080/emp/#/details;
}

浏览器出现404错误

这是我的完整服务器配置:

server { 
  listen 8081;
  server_name xx.xx.xxx.xxx;
  location / { root html; index index.html index.htm; }
  location /employee { proxy_pass localhost:8080/emp/#/details; }
  error_page 500 502 503 504 /50x.html;
  location = /50x.html { root html; } 
}

现在您正在侦听端口 8081,将其更改为 80。

server { 
  listen 80;
  server_name xx.xx.xxx.xxx;
  location / { root html; index index.html index.htm; }
  location /employee { proxy_pass localhost:8080/emp/#/details; }
  error_page 500 502 503 504 /50x.html;
  location = /50x.html { root html; } 
}

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM