首先在springboot项目中配置server.context-path路径:
server:
context-path: /houselease
port:8080
此时启动项目,访问localhost:8080/houselease成功:

那么对应的nginx配置如下即可:

只需输入https://IP/houselease/ 就可以访问了!
参考:https://ask.youkuaiyun.com/questions/691360
本文介绍了如何在SpringBoot项目中配置server.context-path为/houselease,并且展示了对应的Nginx配置,使得通过https://IP/houselease/可以成功访问应用。重点讨论了服务器上下文路径的设置及其在实际部署中的应用。
首先在springboot项目中配置server.context-path路径:
server:
context-path: /houselease
port:8080
此时启动项目,访问localhost:8080/houselease成功:

那么对应的nginx配置如下即可:

只需输入https://IP/houselease/ 就可以访问了!
参考:https://ask.youkuaiyun.com/questions/691360
2457
4903
2121

被折叠的 条评论
为什么被折叠?