Managed to get it working after recompiling nginx from sources.
Probably just had too old version before.
Here's the config i used. Not really sure if the map directive is what it should be,
but both websocket and legacy transports seem to work fine with this.
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream backend {
server
127.0.0.1:9800;
}
# Only retry if there was a communication error, not a timeout.
proxy_next_upstream error;
server {
server_name localhost;
listen 80;
root /path/to/myapp/;
access_log /var/log/nginx/myapp.access.log;
# static files
location / {
}
# sockjs
location /echo {
proxy_pass
http://backend;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
}