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

后端 未结 3 2051
傲寒
傲寒 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 05:07

    Thank you, you saved me tons! I wanted to post this in comments, but I don't have enough reputation to reply.

    Those of you who want the information regarding firewall changes,

    I used firewalld to add my springboot webserver ports in my vm(centos7)

    My webserver was using 8080, so I did:

    firewall-cmd --permanent --reload --zone=public --add-port=8080/tcp*
    
    sudo systemctl restart firewalld*
    

    you need to restart/reload the firewalld to apply the changes. if you,

    sudo firewall-cmd --list-all*
    

    you can find 8080/tcp has been added to ports list

提交回复
热议问题