Reverse proxying on-prem space produces web socket error.

I am currently reverse-proxying my jetbrains space under NGINX with cloudflare proxying as well for SSL.

My config looks like:

server {
    listen 443 ssl;

    add_header Strict-Transport-Security max-age=31536000;

    location / {
            proxy_set_header    X-Real-IP $remote_addr;
            proxy_set_header    Host      $http_host;
            proxy_set_header X-Forwarded-Proto https;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Host $http_host;
            proxy_http_version 1.1;


    ssl_certificate     /etc/ssl/certs/;
    ssl_certificate_key /etc/ssl/certs/;

However I get these websocket errors after signing in:

Firefox can’t establish a connection to the server at wss://

Hey man, u need to change ur reverse proxy to something like that

    location / {
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header X-NginX-Proxy true;
      proxy_pass http://localhost:8084/;
      proxy_redirect off;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";


Now I get this error and can't get to the login page

index.a813e3d5a17b086d0f52.js:1 WebSocket connection to 'wss://' failed: 

I currently have a similar setup with Nginx as my reverse proxy except hat I am getting an IllegalStateException with the message "Unhandled client error while routing, Invalid JWT payload, Are you using an ad blocker? It might be interfering with your ability to access Space."  Anybody have an idea what might cause this?  I am using the default configs generated by the init-configs command.  Or at least how do I enable verbose debug output in Space so that I can see what is going on in the backend?  Thank you for all your help.


Pawel, I contacted you in the support ticket asking for more information about the case. Once the issue is resolved, I'll post an update with the root cause description here.


I was facing the same error. Are You already logged in at internal address? For me simply clearing cookies for Space domains resolved this error.


I'm also having an issue with logging into Space when its running behind Nginx reverse proxy. Any news on this issue?

index.fafdb698def9d27a88cf.js:1 WebSocket connection to 'wss://' failed:
uE @ index.fafdb698def9d27a88cf.js:1
eE.createWebSocket_bmdn1m$$default @ index.fafdb698def9d27a88cf.js:1
ed.createWebSocket_bmdn1m$ @ index.fafdb698def9d27a88cf.js:1
Jl @ index.fafdb698def9d27a88cf.js:1
ph.createConnection_0 @ index.fafdb698def9d27a88cf.js:1
$h.doResume @ index.fafdb698def9d27a88cf.js:1
ph.reconnectCycle_0 @ index.fafdb698def9d27a88cf.js:1
dh.doResume @ index.fafdb698def9d27a88cf.js:1
Ri.resumeWith_tl1gpc$ @ index.fafdb698def9d27a88cf.js:1
na @ index.fafdb698def9d27a88cf.js:1
ia @ index.fafdb698def9d27a88cf.js:1
Qt.dispatchResume_0 @ index.fafdb698def9d27a88cf.js:1
Qt.resumeImpl_0 @ index.fafdb698def9d27a88cf.js:1
Qt.resumeUndispatched_hyuxa3$ @ index.fafdb698def9d27a88cf.js:1
(anonymous) @ index.fafdb698def9d27a88cf.js:1

Tiritto, could it be possible that your nginx configuration doesn't have the following headers included?

      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";



Please sign in to leave a comment.