This question has been asked before but none of the answers really explain why you would want to put something like nginx in front of a wsgi/guincorn server*.
(*) Some answers state that nginx is faster at serving static files. However in the context in which I am asking this question, I do not have any static files to serve.
My application presents a rest api to clients via the internet. Clients send JSON to it, and receive JSON from it.
In this case, what is the advantage of putting a webserver (like nginx) in front of an application? Why shouldn’t I deploy this using Gunicorn directly?
I have deployed applications in the past using Gunicorn directly, and they have worked fine. To provide further context around this, previously I:
- wrote an application using Flask which provided a web interface to download a file (this was literally all it did – it was very simple – I had a file on disk and wanted to share that with other people, and provided a Python Flask app to do so)
- deployed this application using Gunicorn