W
W
wargych2021-12-08 19:17:02
Nginx
wargych, 2021-12-08 19:17:02

Why does the application crash on websocket?

Faced with the fact that the application running on the gorilla websocket is falling. Falls once a minute and is restored.
Moreover, the application itself works fine if you access it, bypassing nginx and ssl.

Unfortunately, not strong in working with nginx.
I believe that the matter is in the nginx configuration, this is how the config of the part responsible for the websocket looks like:

location = /wss{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 36000s;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:9000;
}

I would be grateful for advice on where to look.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Karabanov, 2021-12-08
@karabanov

websocket is a binary protocol, proxying it through Nginx does not provide benefits, but can create problems.
Refuse proxying, forward the application port to the outside, if possible.

N
Nikolay Savelyev, 2021-12-08
@AgentSmith

see errors

W
WTERH, 2015-06-10
@Expany

The issue is resolved, it was necessary to remove the <> brackets

D
Dmitry, 2015-06-10
@thewind

And where is the whole request?)) they don’t wang here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question