2

I currently have a Flask app proxied behind Nginx via uWSGI. Due to my needs for asyncio and websockets, I would prefer to switch to Quart.

I use nginx to manage authentication and performantly/simply serve static files. It would be nice to keep essentially the same configuration through the changeover to Quart, as opposed to trashing it all and running Hypercorn bare; and migrating all my static routes/auth into the Quart app.

What config settings are needed to proxy Quart behind nginx? Perhaps more generally, can Nginx proxy an ASGI application? Is this a sensible thing to do?

trbabb
  • 1,894
  • 18
  • 35

1 Answers1

2

It can, and you don't need to change any of the settings (unless you weren't using WebSockets with Flask, in which case you need to setup nginx to proxy WebSockets as well). I would recommend running Hypercorn directly though as it will allow you to utilise HTTP/2 features in Quart i.e. server-push.

pgjones
  • 6,044
  • 1
  • 14
  • 12