Force Play Framework to listen on localhost only

前端 未结 2 1202
情话喂你
情话喂你 2021-01-06 02:06

How can you force the Play Framework listen on localhost only
i would like that the play will listen on the localhsot:9000 and not on 0.0.0.0:9000
so it won\'t be ac

2条回答
  •  被撕碎了的回忆
    2021-01-06 02:27

    Sad hack around is simply to block off that port to the outside world. Below you're allowing local access, but banning everyone else. This will keep people from bypassing your proxy (i.e. getting around HTTPS if you terminate there).

    iptables -A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 9000 -j ACCEPT
    iptables -A INPUT -p tcp -m tcp --dport 9000 -j DROP
    

    If you bork your iptables settings, just run the following to reset them. PS, don't screw with port 22 if your on a remote VM. ;)

    iptables -F
    

提交回复
热议问题