[GH-ISSUE #926] allow websocket for custom locations #786

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

Originally created by @GurjinderSingh on GitHub (Mar 5, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/926

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

Originally created by @GurjinderSingh on GitHub (Mar 5, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/926 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](https://user-images.githubusercontent.com/3470709/110076856-287d7400-7d53-11eb-8f98-0b027eed9d6a.png)
kerem 2026-02-26 06:34:25 +03:00
Author
Owner

@Stealthii commented on GitHub (Apr 13, 2021):

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.)

<!-- gh-comment-id:818971860 --> @Stealthii commented on GitHub (Apr 13, 2021): 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.)
Author
Owner

@Stealthii commented on GitHub (Apr 13, 2021):

Submitted PR #1017 to fix this issue.

<!-- gh-comment-id:818985618 --> @Stealthii commented on GitHub (Apr 13, 2021): Submitted PR #1017 to fix this issue.
Author
Owner

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

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

<!-- gh-comment-id:835959579 --> @jc21 commented on GitHub (May 10, 2021): 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
Author
Owner

@github-actions[bot] commented on GitHub (Mar 17, 2024):

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

<!-- gh-comment-id:2002267506 --> @github-actions[bot] commented on GitHub (Mar 17, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Apr 29, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2837246893 --> @github-actions[bot] commented on GitHub (Apr 29, 2025): Issue was closed due to inactivity.
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#786
No description provided.