ralscha / sse-eventbus

EventBus library for sending events from a Spring appliction to the web browser with SSE
Apache License 2.0
82 stars 28 forks source link

What are the nginx configurations for SSE #18

Closed titoc closed 4 years ago

titoc commented 4 years ago

This is more of a question than an issue. What should be the nginx conf required for a url path for SSE. For example: /events url path in nginx should be configured with which options. Thanks !

ralscha commented 4 years ago

I use this configuration in my application

  location / {
    proxy_pass http://127.0.0.1:8081;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_read_timeout 410s;
  }

The important settings are proxy_buffering and proxy_read_timeout