gpt4 book ai didi

tomcat - 无法将 nginx 配置为具有上下文路径的 tomcat 的代理

转载 作者:行者123 更新时间:2023-11-28 21:58:03 25 4
gpt4 key购买 nike

http://localhost:8080/application 上拥有可访问应用程序的 Tomcat .

想通过 url http://app.ru 访问此应用程序.所以这是 nginx 代理配置:

server {
server_name app.ru .app.ru;
listen 80;
location / {
proxy_pass http://localhost:8080/application;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

移动到http://app.ru时,它返回 302 重定向到 http://app.ru/application

如何解决?

最佳答案

感谢@Richard Smith 的评论。我忘记了结尾的斜线。

关于tomcat - 无法将 nginx 配置为具有上下文路径的 tomcat 的代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37459006/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com