Search code examples
pythonvirtualhostwaitress

How to do reverse proxy on waitress server for Python Flask Application


I am a newbie in web deployment and I have a flask application which is being hosted at 0.0.0.0:5070. Now I want to do the reverse proxy and be able to direct a certain hostname (bound to server IP) to this port. I have tried the Waitress documentation but seems to be of no help. Any guidance in this will be highly appreciated. Thanks.


Solution

  • Basically, what @Debendra mentioned is correct. For production workload, it is recommended to use uwsgi as your application server.

    From there, you'll need to use a web server to act as your reverse proxy. Please refer the following documents:

    What is uWSGI?

    How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 18.04

    Read the above to become familiar with the components and submit another question if you want a follow up.