2 posts tagged


I've encountered issue with dropped SSE connection when deployed SSE based sinatra app with SSL certificates and nginx-proxy docker container.

First, create vhost.d directory on host and connect it to /etc/nginx/vhost.d in nginx-proxy container via volume. Create corresponding file to your VIRTUAL_HOST name, which will be included upon nginx startup. In my case that was SSE stream.it-premium.com.ua.

My /home/nexus/vhost.d/stream.it-premium.com.ua file is following

proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;

But it has still issues with dropped connection.
Finally I've updated app code with following headers:

response['Cache-control'] = 'no-cache'
response['X-Accel-Buffering'] = 'no'

And everything run smoothly after deploy.

In case your nginx is asking for certification password each time when nginx starts, use following hint:

openssl rsa -in website.com.key_secure.key -out website.com.key