question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Websockets are not working anymore after changing a host in version v2.9.0

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jc21commented, 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
3reactions
jlesagecommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebSocket connection failed. Error in browser console, since ...
No change was done to the existing dashboards, all was working great before. The messages just start appearing after upgrading from 8.0.3.
Read more >
Error with WebSocket - Microsoft Q&A
Hello I get the error: WebSocket connection to 'wss://localhost:54970/Dashboard.Server/' failed: Error in connection establishment: ...
Read more >
websocket closing connection automatically - Stack Overflow
I'm building an application in java that has an embedded websocket server based on jetty. The client is the default websocket implementation in...
Read more >
How do I troubleshoot WebSocket issues in Agents (All ...
Ensure any load balancers or reverse proxies configured in your environment support WebSocket protocols. If they do not, you will see errors ...
Read more >
Investigating WebSocket Server Security - Erik Elbieh - YouTube
We're not in HTTP anymore : Investigating WebSocket Server Security ... Security Researcher and Consultant Description While HTTP is the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found