I
I
i_want_to_know_everything2016-12-06 07:11:11
Nginx
i_want_to_know_everything, 2016-12-06 07:11:11

Nginx WebSocket proxying?

Where did I screw up?
nginx config

server {
    listen 80;

    server_name subdomain.domain.com;

    location /{
        access_log off;

        proxy_pass http://localhost:3030;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

knocking ws://subdomain.domain.com - not working
knocking ws://xxx.xxx.xxx.xxx:3030 - all ok
knocking ws://localhost:3030 - not working

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Batalov, 2016-12-06
@i_want_to_know_everything

Most likely IPv6 is enabled and the connection goes not to 127.0.0.1 but to ::1 which resolves to localhost.
or vice versa the server listens on IPv6 only
see netstat -pln

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question