mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-26 01:45:54 +03:00
[GH-ISSUE #723] Websocket configuration #614
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#614
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Wadera on GitHub (Nov 16, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/723
What is troubling you?
I'm struggled to configure websocket nginx on my NPM:
https://extiverse.com/extension/kyrne/websocket
That's my current config:
Full Custom Nginx Configuration:
Where
1324is the port of my websocket application.Unfortunately - I can't establish connection. From browser console:
I can connect into it without proxy like:
wss://dev.mywebsite.com:1234What I'm doing wrong?
@Wadera commented on GitHub (Nov 16, 2020):
from tcpdump
where
192.168.1.123is my docker host (NMP) IP.@Wadera commented on GitHub (Nov 23, 2020):
Anyone?
Boss: @jc21 - any advise? :)
@jc21 commented on GitHub (Nov 23, 2020):
This seems like a complicated configuration. You're essentially wanting your proxy host to route between 2 different ports, one for general http and the other for a websocket server.
The first thing I can see is that you have defined a named nginx location
@wsbut you're not using it anywhere in any requests. You probably need something likeand what I can see is a request to
wss://dev.mywebsite.com/app/(...)?but without knowing what's missing in those 3 dots it might be hard to define the location properly.@jc21 commented on GitHub (Nov 23, 2020):
Also, why hide proxy headers? Especially the Upgrade one which is required for websocket support.
@Wadera commented on GitHub (Dec 3, 2020):
Thank you very much for support!
It's working with setup like that:
@GurjinderSingh commented on GitHub (Mar 5, 2021):
I have solved my same problem by adding inside location block. password protect domain with access and https enabled. now both works like well-oiled engine.
@MarKramMich commented on GitHub (Mar 8, 2021):
Hi
I am struggling with the same issue :( And get stuck.
my conf in NPM:
#proxy_hide_header Upgrade;
proxy_hide_header X-Powered-By;
add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Cache-Control "no-transform" always;
add_header Referrer-Policy no-referrer always;
add_header X-Robots-Tag none;
location /wss {
try_files $uri @ws;
}
location @ws {
proxy_pass http://$server:8888;
proxy_set_header Host $http_host;
proxy_read_timeout 60;
proxy_connect_timeout 60;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
and still getting 400 error:
websocket connection failed error during websocket handshake unexpected response code 400
could please someone look at this conf ? where is the problem ?
@GurjinderSingh commented on GitHub (Mar 9, 2021):
first do you declare $server var ?
second i faced same problem with phpmyadmin you have to end proxy_pass with / .
proxy_pass http://$server:8888; >> proxy_pass http://$server:8888/;
please read :https://github.com/jc21/nginx-proxy-manager/issues/927
@conichonhaa commented on GitHub (Feb 27, 2022):
Is it possible to write a documentation for websocket? There's only a few article with npm and websocket. I've got a fully functional websocket but when I try to migrate from my old nginx reverse proxy to npm, I can't set the websocket part correctly
@ilisparrow commented on GitHub (Mar 28, 2023):
Hello,
In case you just need to forward sockets (in my case for streamlit), you can toggle this button :
Hope this helps someone.
@hybrdthry911 commented on GitHub (Mar 31, 2023):
Helped me. Must have been one of those things my eyes saw but my brain filtered out when it was right in front of me. Kept getting wss:// errors until this was toggled.