Francis Daly
April 19, 2020 02:56PM
On Sat, Apr 18, 2020 at 05:39:38PM -0400, YAGA wrote:

Hi there,

> From local network, the nginx web site of the “black box” is working
> properly including websocket connection.

> From Internet, the “server”, the nginx reverse proxy gives me an access to
> the nginx web site of the “black box” everything works except the websocket,
> from my web browser I receive a status 200 but I should get 101 switching
> protocol.

Your config for the "black box" does not show the normal proxy_*
directives that are used for websockets.

Your config for the "server" does.

http://nginx.org/en/docs/http/websocket.html

Does anything change if you add those directives to the "black box" system?

> “black box” web server nginx config (extract)

> location /websocket {
> proxy_pass https://127.0.0.1:80;
> }

> “server” reverse proxy nginx config (extract)

> location /websocket {
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection upgrade;
> proxy_http_version 1.1;
> proxy_set_header Origin "";
> proxy_pass https://192.168.1.20:80/;
> auth_basic off;
> }

I don't actually know if a websocket connection will pass cleanly through
two reverse proxies. I guess this is as good a time as any to learn if
it can!

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Websocket (wss) connection issue (status 200 instead 101) between two nginx systems

YAGA April 18, 2020 05:39PM

Re: Websocket (wss) connection issue (status 200 instead 101) between two nginx systems

Francis Daly April 19, 2020 02:56PM

Re: Websocket (wss) connection issue (status 200 instead 101) between two nginx systems

YAGA April 20, 2020 05:06PM

Re: Websocket (wss) connection issue (status 200 instead 101) between two nginx systems

Francis Daly April 22, 2020 03:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready