Issue
I want to use gunicorn for a REST API application with Flask/Python. What is the purpose of adding nginx here to gunicorn? The gunicorn site recommends using gunicorn with nginx.
Solution
Nginx has some web server functionality (e.g., serving static pages; SSL handling) that gunicorn does not, whereas gunicorn implements WSGI (which nginx does not).
... Wait, why do we need two servers? Think of Gunicorn as the application web server that will be running behind nginx – the front- facing web server. Gunicorn is WSGI-compatible. It can talk to other applications that support WSGI, like Flask or Django.
Source: https://realpython.com/blog/python/kickstarting-flask-on-ubuntu-setup-and-deployment/
Answered By - eddys
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.