0

I try to forward a path to a specific url, where my websocket request has to go. It listens on the port 8180. I found the examples from Nico Kaiser.

My nginx config now looks like the following:

location /sideview/frontend {
    access_log off;

    proxy_pass http://domain.de:8180;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    # WebSocket support (nginx 1.4)
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

    # Path rewriting
    rewrite /sideview/frontend/(.*) /$1 break;
    proxy_redirect off;
}

When I try to connect to the URL, the error: *2508595 no live upstreams while connecting to upstream, client: 87.79.66.136, server: domain.de, request: "GET /sideview/frontend/ws HTTP/1.1", upstream: "http://domain.de/ws", host: "domain.de"

The requests also didn't reach the websockets server, as the logs tells me.

What do I have to change, to get it right?

1 Answer 1

2

For one, it sounds like domain.de is not responding properly on that port. If this is the same server hosting both, you may need to change this to localhost.

Second,

proxy_set_header Connection "upgrade";

Should use a capital "U"

proxy_set_header Connection "Upgrade";

This distinction between capital and lowercase U is not documented anywhere, but some servers require one and some don't make a distinction.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.