Welcome! Log In Create A New Profile

Advanced

Re: Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

Sergey Kandaurov
June 10, 2021 08:02AM
> On 10 Jun 2021, at 13:14, raphy <nginx-forum@forum.nginx.org> wrote:
>
> In order to use XMPP with websocket, and take advantage of nginx
> capabilities to proxy to 443 and to serve multiple domains, I've configured
> nginx as follows:
>
>
> server {
> listen 443 ssl http2 default_server;
> server_name grasp.deals www.grasp.deals;
> ssl_certificate /etc/letsencrypt/live/grasp.deals/fullchain.pem; #
> managed by Certbot
> ssl_certificate_key /etc/letsencrypt/live/grasp.deals/privkey.pem; #
> managed by Certbot
> ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
>
[..]
> }
>
> In the app I'm developing, when I switch from BOSH (http-bind), which works
> fine:
>
> let [conn, setConn] = React.useState(new
> Strophe.Connection("https://grasp.deals/http-bind"));
>
> to websocket:
>
> let [conn, setConn] = React.useState(new
> Strophe.Connection("wss://grasp.deals/xmpp-websocket"));
>
> I get this error:
>
> WebSocket connection to 'wss://grasp.deals/xmpp-websocket' failed: Error
> during WebSocket handshake:
> Unexpected response code: 403

nginx doesn't support bootstrapping WebSockets with HTTP/2.

--
Sergey Kandaurov

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

raphy June 10, 2021 06:14AM

Re: Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

Sergey Kandaurov June 10, 2021 08:02AM

Re: Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

raphy June 10, 2021 09:04AM

Re: Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

Sergey Kandaurov June 10, 2021 10:12AM

Re: Nginx Configuration for websocket: Error during WebSocket handshake: Unexpected response code: 403

Maxim Dounin June 10, 2021 10:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 171
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready