0

I'm trying to deploy that project on a self-hosted server with self-signed SSL.
Using NGINX reverse proxy for HTTP->HTTPS redirection.
The server works partially, for example, the channel cannot connect to the "Event stream".

See printscreen:
Event stream Error

What is wrong with our NGINX settings?!

While debugging the server I found that defineGetter returns HTTP protocol despite the fact that we run behind a reverse proxy:

request.js debug printscreen

I added the enviroment variable before running the npm start:

export NODE_TLS_REJECT_UNAUTHORIZED=0  

See our NGINX settings:

server {
            listen              443 ssl;
            server_name         servername;
            ssl_certificate     /tmp/ssl_key/crt/servername.crt;
            ssl_certificate_key /tmp/ssl_key/crt/servername.rsa;
            ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
            ssl_ciphers         HIGH:!aNULL:!MD5;
            #...

            location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_redirect      http:// https://;
                }
        }
Dima Kreisserman
  • 663
  • 1
  • 13
  • 33

1 Answers1

0

The root cause is "No response from Event source" during the access from the client.
Solved by changing the NGINX reverse proxy settings.
Base on that post EventSource / Server-Sent Events through Nginx.

Our new NGINX settings are:

 location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection '';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
                proxy_redirect      http:// https://;
                chunked_transfer_encoding off;
                proxy_buffering off;
                proxy_cache off;
                }
Dima Kreisserman
  • 663
  • 1
  • 13
  • 33