nginx配置无根tomcat应用代理出现双斜杠问题

问题描述-nginx日志
问题描述-后台(spring-security)
负载均衡配置
反向代理配置
访问url配置

第二天发现以上配置无法使用,于是给访路径加上/,然后更改nginx配置为


nginx最终配置
    location /api{
            proxy_pass       http://test;
            rewrite /api/(.+)$ /$1 break;
            proxy_set_header   Host             $proxy_host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_pass_request_headers              on;
    }

参考:
https://www.cnblogs.com/lemon-le/p/7800879.html
https://www.jianshu.com/p/89201a82528d
https://www.oschina.net/question/54100_30402

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容