Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP2 with gunicorn

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.

like image 763
Vini.g.fer Avatar asked May 25 '17 19:05

Vini.g.fer


People also ask

Does http2 support Gunicorn?

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.

Does https support Gunicorn?

Gunicorn wsgi server allows users to use HTTPS connection directly without a need to use HTTP server like Nginx or Apache.

Does Django support http2?

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.

Is Gunicorn a Wsgi?

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.


1 Answers

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.

like image 94
christian Avatar answered Sep 19 '22 14:09

christian