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?
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.
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