I got websocket servers and there are behind nginx. I need to configure second nginx as proxy to this first nginx. But when I make a request, there is an error 400 or 404 (with different configs).
Here is my config of my nginx:
map $http_upgrade $is_upgrade {
default upgrade;
'' '';
}
upstream websocket {
server [here_is_address];
}
server {
listen 80 default;
location /ws/ {
proxy_http_version 1.1;
client_max_body_size 50m;
proxy_read_timeout 60s;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $is_upgrade;
proxy_pass http://websocket;
}
}