NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.61k stars 2.63k forks source link

allow websocket for custom locations #926

Open GurjinderSingh opened 3 years ago

GurjinderSingh commented 3 years ago

thank you for creating marvellous product.

Is your feature request related to a problem? Please describe. current websocket options only working for location "/"

Describe the solution you'd like need to add on/off checkbox for custom location to allow web socket.

needs to add these extra config in custom locations.

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_http_version 1.1;

Describe alternatives you've considered i don't think so.

Additional context

https://github.com/jc21/nginx-proxy-manager/issues/723#issuecomment-791188669

image

Stealthii commented 3 years ago

This is in tandem with the "Force HTTPS" option. Both of these are incorrectly placed under the "location /" section, rather than the root config (like asset caching, block common exploits, and HTTP/2 support).

It would make sense (in most cases) for these options to apply to all custom locations, rather than be configurable per location. A quick fix would be to move these definitions into the root config, with a future enhancement to make these options more configurable (however custom configuration exists already to override / add parameters.)

Stealthii commented 3 years ago

Submitted PR #1017 to fix this issue.

jc21 commented 3 years ago

So as we discovered, that broke websockets for location / because of they way proxy headers are used. Instead I think the fix should be to add the websockets and force https checks within the custom locations section when generating the nginx conf.

1081 is already created for that, but requires a lot of testing

github-actions[bot] commented 7 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: