Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headers to support nginx proxying #34

Open
jaykobi opened this issue Aug 23, 2021 · 1 comment
Open

Add headers to support nginx proxying #34

jaykobi opened this issue Aug 23, 2021 · 1 comment

Comments

@jaykobi
Copy link

jaykobi commented Aug 23, 2021

Hello @singingwolfboy ,

I use a setup where the SSE stream requests are poxied by nginx. This did not work until I added headers to the python response as described here. There is a very similar issue already closed in this repo: #3.

The important part, though, is that the headers must be set by the app server, not in nginx. I created a PR to show you how it could be solved in flask-sse.

@irishpines
Copy link

Thanks @jaykobi!

When I couldn't get the example script to work outside of the localhost connection I just decided to read all the issues in the hope of finding a clue. Yours was what I needed. Actually, following the links I found the Nginx configuration settings I needed to change as an alternative to setting the headings by the app server (as in your PR), which was good enough for my purposes.

@singingwolfboy I think this should be mentioned in the documentation - the event stream just won't work with an Nginx server out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants