vendredi 28 septembre 2018

FLASK listen / bind host to multiple IPs addresses

I want to serve my flask app, and bind to two hosts. first is localhost, 127.0.0.1, and also the LAN IP address (192.168.1.143)

I want to do something like this:

flask run --host=127.0.0.1 --host=192.168.1.143

or

flask run --host=127.0.0.1,192.168.1.143

but this does not work.

I do NOT want to listen on 0.0.0.0 (all interfaces) due to security reasons. I only want traffic coming from LAN and localhost.

I'm thinking I need to put apache or NGINX in front of my flask app, and do binding this way, but I am not sure how to do this, or where to search.

Any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire