Is it possible to run a Django Application using Gunicorn and HTTP2? Currently we have Nginx in front of our application working as a reverse proxy, but we may drop it in the future, since we are starting to migrate to docker swarm.
I could not find any docs/links regarding configuration of gunicorn with HTTP2. Does anybody knows if it is possible to do it, without using nginx?
If not possible, please suggest other webservers that can achieve that.
Gunicorn is a WSGI HTTP server for Python applications. It can serve your dynamic Python application with the help of a reverse-proxy program like Nginx. Daphne is like Gunicorn but for ASGI. It also supports the HTTP/2.0 and WebSocket protocols in addition to Gunicorn.
Gunicorn wsgi server allows users to use HTTPS connection directly without a need to use HTTP server like Nginx or Apache.
Current framework state Hypercorn supports HTTP/2, meaning that Quart and any other ASGI framework can use Hypercorn to serve HTTP/2. There are a number of frameworks exploring HTTP/2, including Tornado, Django (via channels and ASGI), and Sanic.
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn server is broadly compatible with various web frameworks, simply implemented, light on server resources, and fairly speedy.
gunicorn doesn't currently support HTTP/2. There's a tracking issue for it.
You can still use nginx with docker swarm. If you want to dynamically update the configuration, you can use something like docker-proxy
If you want an alternative for use with docker swarm, I can recommend traefik. Although I haven't tried it with HTTP/2, it is meant to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With