-
Notifications
You must be signed in to change notification settings - Fork 32
Can't get SSE to work behind Nginx #2
Comments
Hi Mateo, it seems to work well on https://botbot.me. Here's the setup we have (using uWSGI behind Nginx):
We actually run a separate uwsgi worker under gevent to serve these requests. I'm not 100% sure that is necessary, but here's the relevant settings we're using there:
Keep us posted on what you find out. We should document some recommendations here. |
I'm trying a similar setup, using a single uwsgi worker uwsgi --gevent 1000 --async 100 --gevent-monkey-patch --socket botbot.sock --wsgi-file botbot/wsgi.py and a single upstream botbot {
server unix:///path/to/botbot.sock fail_timeout=30s;
}
location / {
include uwsgi_params;
uwsgi_pass botbot;
uwsgi_buffering off;
chunked_transfer_encoding off;
proxy_cache off;
} still getting the timeouts though :( I guess I'll wait for the deployment documentation... |
@malteo do you see the same issue on the channels on https://botbot.me ? I'd love to help you get this resolved, but want to make sure we have it right first :) |
@ipmb you're right, it happens on botbot.me too! Just go on a channel without much traffic and wait ~60 seconds with (I'm using Firefox) the web console open and you'll see a 504 from Nginx and the page stops live-updating. I guess the EventSource needs a sort of keep-alive ping or something... |
Give this a shot...
It catches the timeout and returns a response that SSE is happy with. |
Yes! Thank you |
I'm trying to serve the web interface through a Nginx reverse proxy, but the EventSource request is failing after not receiving anything for a couple of minutes with a 504 timeout.
Everything works in static interfaces (like the admin one) or when directly accessing the Django server.
These are the relevant Nginx config parts:
Have you managed to get it working? How's your deployment setup?
The text was updated successfully, but these errors were encountered: