[GH-ISSUE #1067] Websockets are not working anymore after changing a host in version v2.9.0 #893

Closed
opened 2026-02-26 06:34:50 +03:00 by kerem · 7 comments
Owner

Originally created by @Nenodema on GitHub (May 6, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1067

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?

Yes

  • Are you sure you're not using someone else's docker image?

Yes

Describe the bug

  • A clear and concise description of what the bug is.

After the upgrade to version 2.9.0 websockets seems not work anymore (after a change while on version 2.9.0), when i switch back to version 2.8.1 and perform the following steps its working again.

1. click on my proxy host (the entry with the websocket toggle enabled)
2. Toggle (disable) websocket
3. Press save
4. click again on my proxy host
5. Toggle (enable) websocket
6. Press save
7. working

When i start the 2.9.0 container and follow the above steps the websockets are not working anymore.

  • What version of Nginx Proxy Manager is reported on the login page?

v2.9.0

Additional context
Error in chrome dev tools: "Unable to connect to ****." websocket failed. Unfortunately i cloud not found any relevant log files.

I guess it has something todo with the following PR: https://github.com/jc21/nginx-proxy-manager/pull/1017

Originally created by @Nenodema on GitHub (May 6, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1067 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? _Yes_ - Are you sure you're not using someone else's docker image? _Yes_ **Describe the bug** - A clear and concise description of what the bug is. _After the upgrade to version 2.9.0 websockets seems not work anymore (after a change while on version 2.9.0), when i switch back to version 2.8.1 and perform the following steps its working again._ _1. click on my proxy host (the entry with the websocket toggle enabled) 2. Toggle (disable) websocket 3. Press save 4. click again on my proxy host 5. Toggle (enable) websocket 6. Press save 7. working_ _When i start the 2.9.0 container and follow the above steps the websockets are not working anymore._ - What version of Nginx Proxy Manager is reported on the login page? _v2.9.0_ **Additional context** _Error in chrome dev tools: "Unable to connect to ****." websocket failed. Unfortunately i cloud not found any relevant log files._ I guess it has something todo with the following PR: https://github.com/jc21/nginx-proxy-manager/pull/1017
kerem 2026-02-26 06:34:50 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jiriteach commented on GitHub (May 7, 2021):

I am experiencing this as well. Have seen it on 2.9.0 and 2.9.1. Websockets are not working anymore.

<!-- gh-comment-id:834314288 --> @jiriteach commented on GitHub (May 7, 2021): I am experiencing this as well. Have seen it on 2.9.0 and 2.9.1. Websockets are not working anymore.
Author
Owner

@jlesage commented on GitHub (May 7, 2021):

The issue has been introduced with the following change: github.com/jc21/nginx-proxy-manager@421934efed

The proxy_set_header directives required for WebSocket cannot be moved out from the location level. According to http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header:

These directives are inherited from the previous configuration level if and only if there are no proxy_set_header directives defined on the current level.

So because of the inclusion of conf.d/include/proxy.conf (which has proxy_set_header directives) under location, the directives for WebSocket are ignored.

<!-- gh-comment-id:834634914 --> @jlesage commented on GitHub (May 7, 2021): The issue has been introduced with the following change: https://github.com/jc21/nginx-proxy-manager/commit/421934efedd12ba047f78243fb25388a613e29f8 The `proxy_set_header` directives required for WebSocket cannot be moved out from the `location` level. According to http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header: > These directives are inherited from the previous configuration level if and only if there are no proxy_set_header directives defined on the current level. So because of the inclusion of `conf.d/include/proxy.conf` (which has `proxy_set_header` directives) under `location`, the directives for WebSocket are ignored.
Author
Owner

@jc21 commented on GitHub (May 8, 2021):

Ah good pickup @jlesage - rookie move letting this go by on my part.

So from this explanation, I've committed this so anyone creating a custom location block without proxy_set_header directives will still have websocket support, though I can't see why they would use websockets if not proxy'ing 🤷

When this build is green (and not before, eta ~2 hours) anyone is welcome to test this change by using the github-develop docker tag. I won't be able to test this myself for about 8 hours due to prior commitments.

To test:

  • Create a new proxy host with websockets on OR
  • Edit an existing proxy host you know wasn't working before and save it, it will write the new nginx config and reload nginx
<!-- gh-comment-id:834975417 --> @jc21 commented on GitHub (May 8, 2021): Ah good pickup @jlesage - rookie move letting this go by on my part. So from this explanation, I've [committed this](https://github.com/jc21/nginx-proxy-manager/commit/ba457055716431dfae62ae951fa8a6cf7132e419) so anyone creating a custom location block without `proxy_set_header` directives will still have websocket support, though I can't see why they would use websockets if not proxy'ing 🤷 When [this build](https://ci.nginxproxymanager.com/job/nginx-proxy-manager/job/develop/180/) is green (and not before, eta ~2 hours) anyone is welcome to test this change by using the `github-develop` docker tag. I won't be able to test this myself for about 8 hours due to prior commitments. To test: - Create a new proxy host with websockets on OR - Edit an existing proxy host you know wasn't working before and save it, it will write the new nginx config and reload nginx
Author
Owner

@jiriteach commented on GitHub (May 8, 2021):

Awesome - Thanks. Just pulled github-develop and tried it. Websockets is working as expected again. I did have to open an existing rule and resave and working fine. Thanks

<!-- gh-comment-id:835166482 --> @jiriteach commented on GitHub (May 8, 2021): Awesome - Thanks. Just pulled github-develop and tried it. Websockets is working as expected again. I did have to open an existing rule and resave and working fine. Thanks
Author
Owner

@serotonie commented on GitHub (May 9, 2021):

Had the same issue in the Morning.
github-develop also solved this for me :)
When will you commit in the latest branch ?
Thx

<!-- gh-comment-id:835742853 --> @serotonie commented on GitHub (May 9, 2021): Had the same issue in the Morning. github-develop also solved this for me :) When will you commit in the latest branch ? Thx
Author
Owner

@jc21 commented on GitHub (May 9, 2021):

My weekend plans took longer than expected. Working on a new release today.

<!-- gh-comment-id:835903272 --> @jc21 commented on GitHub (May 9, 2021): My weekend plans took longer than expected. Working on a new release today.
Author
Owner

@jc21 commented on GitHub (May 10, 2021):

Fixed in 2.9.2 release

<!-- gh-comment-id:835955514 --> @jc21 commented on GitHub (May 10, 2021): Fixed in 2.9.2 release
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#893
No description provided.