如何在Tomcat上运行基于SpringBoot的Web应用程序而不显示端口号



我在 Spring Boot on localhost 上有应用程序,url 是:127.0.0.1:8080 。是否可以省略端口?我的意思是我想写127.0.0.1并得到这个网站。

在文件 application.properties 中,设置

server.port=80

然后,您可以在以下位置访问网络应用程序: http://127.0.0.1

参考: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-customizing-management-server-port

最新更新