Answer the question
In order to leave comments, you need to log in
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;
}
Answer the question
In order to leave comments, you need to log in
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question