morethanwords / tweb

Telegram Web K, GPL v3
https://web.telegram.org/k/
GNU General Public License v3.0
1.87k stars 599 forks source link

Nginx reverse proxy API error: WebSocket connection to'wss://...' failed: Error during WebSocket handshake: Unexpected response code: 404 #30

Closed ghost closed 3 years ago

ghost commented 3 years ago

When I want to reverse proxy the website, I cannot reverse proxy the WSS:// link, and the browser prompts the following error:

WebSocket connection to 'wss://pluto.web.telegram.org/apiws' failed: Error during WebSocket handshake: Unexpected response code: 404

01

Nginx has added the following:

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';

Hope you can help me!