Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
uWSGI support of nginx ingress controller? #143
I'll explain this as I understand it.
uwsgi has its own binary protocol to avoid the overhead of gratuitous http parsing. http://uwsgi-docs.readthedocs.io/en/latest/FAQ.html#why-not-simply-use-http-as-the-protocol
When running uwsgi as an app server behind nginx, it is customary to use
To be clear: nginx itself does NOT embed uwsgi in-process here, or get involved with WSGI or python: uwsgi is running in another process that may be somewhere else, to take care of the job of an (e.g.) python app server, and it simply talks to nginx as an upstream using the uwsgi protocol. This means all that is required on the nginx side is the ability to accept configuration of uwsgi as an upstream and the ability to speak that protocol as is often done with nginx.
So, not speaking for yue9944882, the very typical use case would be:
Supporting uwsgi_pass should be analogous to supporting other protocols that are used for app servers to talk to nginx.
Hope this helps.
However, for an edge load balancer, such as an Ingress controller, it is not typical to support uwsgi.
What I'd rather do, is using the embedded HTTP server that uWSGI has: http://uwsgi-docs.readthedocs.io/en/latest/HTTP.html Your ingres can connect directly with that, so there is no need for a second nginx pod. This way you can run a single container that has uwsgi as main process. Use a config file like:
and set default values for your environment variables in your container:
When you use Django, you can use whitenoise (http://whitenoise.evans.io/) to serve media/static files from your container. In this example, I've used UWSGI directly for that. Preferably, those are cached at your loadbalancer / ingres / cloudfrond environment to avoid hitting the container each time. Thanks to the