How to setup spring-boot to allow access to the webserver from outside IP addresses

后端 未结 3 2052
傲寒
傲寒 2020-12-14 04:08

I have been looking into how to setup tomcat within spring-boot to allow access from outside IP addresses. Currently I can view the UI from locaho

3条回答
  •  不知归路
    2020-12-14 04:47

    Since so many people have viewed this question. The resolution was to make sure the firewall was configured correctly on the hosting CentOS machine and not set the server address explicitly.

    INCORRECT SETUP

    This failed previously with the firewall incorrectly setup

    server.port=8081
    server.address=192.168.0.93
    

    Once the firewall is correctly setup you do not need to specify the server.address just the port.

    CORRECT SETUP

    server.port=8081
    

    This allowed me to access the application correctly from other systems using its ip.

    http://:
    http://192.168.0.93:8081
    

提交回复
热议问题