[GH-ISSUE #2736] I proxy my code-server through nginx-proxy-manager and got an error #1884

Closed
opened 2026-02-26 07:32:55 +03:00 by kerem · 9 comments
Owner

Originally created by @snicoe on GitHub (Mar 23, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2736

my English is not good, please don't mind -_-lol
I deployed the project on docker and successfully obtained the ssl certificate,the code-server is deployed on my homelab server. I proxy the code-server port through, when I access it with the domain, the code-server returns an error of "websocket 1006". By adding
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
establish websocket connection normally, I want to know the reason.

Originally created by @snicoe on GitHub (Mar 23, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2736 my English is not good, please don't mind -_-lol I deployed the project on docker and successfully obtained the ssl certificate,the code-server is deployed on my homelab server. I proxy the code-server port through, when I access it with the domain, the code-server returns an error of "websocket 1006". By adding proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; establish websocket connection normally, I want to know the reason.
kerem 2026-02-26 07:32:55 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@theraw commented on GitHub (Apr 3, 2023):

code-server requires websocket support so you have to enable it
image

<!-- gh-comment-id:1493683180 --> @theraw commented on GitHub (Apr 3, 2023): code-server requires websocket support so you have to enable it ![image](https://user-images.githubusercontent.com/32969774/229418544-8fee5cd9-b470-4620-95eb-817cac8886f4.png)
Author
Owner

@lauren12133 commented on GitHub (Jun 7, 2023):

image

image

image

useless!!!!

<!-- gh-comment-id:1580106406 --> @lauren12133 commented on GitHub (Jun 7, 2023): ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/77604108/4105c16d-4836-45a8-adda-34ed117b26d0) ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/77604108/7a2ca568-dd1e-4f82-8ced-1ff6a19d8e6f) ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/77604108/3a5d606d-52de-40e4-b0ce-f1e6eaee6f52) useless!!!!
Author
Owner

@snicoe commented on GitHub (Jun 8, 2023):

code-server requires websocket support so you have to enable it image

websockets support is enabled,websocket 1006 is still reported, like @lauren12133

<!-- gh-comment-id:1582098897 --> @snicoe commented on GitHub (Jun 8, 2023): > code-server requires websocket support so you have to enable it ![image](https://user-images.githubusercontent.com/32969774/229418544-8fee5cd9-b470-4620-95eb-817cac8886f4.png) websockets support is enabled,websocket 1006 is still reported, like @lauren12133
Author
Owner

@wbrione commented on GitHub (Oct 5, 2023):

Same stuff here !!! "Websockets Support" option has no effect all :-(

<!-- gh-comment-id:1748978023 --> @wbrione commented on GitHub (Oct 5, 2023): Same stuff here !!! "Websockets Support" option has no effect all :-(
Author
Owner

@snicoe commented on GitHub (Oct 5, 2023):

@wbrione bro i solved this problem :) maybe help.
Add “Custom Nginx Configuration", no other changes are needed.

location /
{
    proxy_pass http://[YOUR_SERVER_IP]:9901;
    proxy_set_header Host [YOUR_DOMAIN]:25052;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header   Upgrade          $http_upgrade;  
    proxy_set_header   Connection       "Upgrade";
    proxy_connect_timeout      60;   
    proxy_send_timeout         90;   
    proxy_read_timeout         90; 
    proxy_buffer_size          4k; 
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    64k;  
    proxy_temp_file_write_size 64k;
    add_header X-Cache $upstream_cache_status;
}

change the [YOUR_SERVER_IP], [YOUR_DOMAIN] and server port to your own

<!-- gh-comment-id:1749003876 --> @snicoe commented on GitHub (Oct 5, 2023): @wbrione bro i solved this problem :) maybe help. Add “Custom Nginx Configuration", no other changes are needed. ``` location / { proxy_pass http://[YOUR_SERVER_IP]:9901; proxy_set_header Host [YOUR_DOMAIN]:25052; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header REMOTE-HOST $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_connect_timeout 60; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; add_header X-Cache $upstream_cache_status; } ``` change the [YOUR_SERVER_IP], [YOUR_DOMAIN] and server port to your own
Author
Owner

@wbrione commented on GitHub (Oct 5, 2023):

@snicoe

image

So, i created a "custom location", but... same error... in fact, some errors are still very specific, like...

Unable to open 'workspace'
Unable to resolve resource vscode-remote://<my domain>/config/workspace

or

ENOPRO: No file system provider found for resource 'vscode-remote:/config/data/User/settings.json'

So... back in your tip... I believe that plus change the [SERVER_IP] and [DOMAIN], i need replace the ports of two first lines, right ?!

Ports: 9901 and 25052... i don't recognize this 😳

<!-- gh-comment-id:1749201444 --> @wbrione commented on GitHub (Oct 5, 2023): @snicoe ![image](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/66576320/ba808756-84da-4f74-aa49-c0630356dc99) So, i created a "custom location", but... same error... in fact, some errors are still very specific, like... ``` Unable to open 'workspace' Unable to resolve resource vscode-remote://<my domain>/config/workspace ``` or `ENOPRO: No file system provider found for resource 'vscode-remote:/config/data/User/settings.json'` So... back in your tip... I believe that plus change the [SERVER_IP] and [DOMAIN], i need replace the ports of two first lines, right ?! Ports: 9901 and 25052... i don't recognize this :flushed:
Author
Owner

@snicoe commented on GitHub (Oct 5, 2023):

@wbrione yes ,you need replace the ports of two first lines

<!-- gh-comment-id:1749255375 --> @snicoe commented on GitHub (Oct 5, 2023): @wbrione yes ,you need replace the ports of two first lines
Author
Owner

@WannaYoung commented on GitHub (Oct 25, 2023):

@wbrione bro i solved this problem :) maybe help. Add “Custom Nginx Configuration", no other changes are needed.

location /
{
    proxy_pass http://[YOUR_SERVER_IP]:9901;
    proxy_set_header Host [YOUR_DOMAIN]:25052;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header   Upgrade          $http_upgrade;  
    proxy_set_header   Connection       "Upgrade";
    proxy_connect_timeout      60;   
    proxy_send_timeout         90;   
    proxy_read_timeout         90; 
    proxy_buffer_size          4k; 
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    64k;  
    proxy_temp_file_write_size 64k;
    add_header X-Cache $upstream_cache_status;
}

change the [YOUR_SERVER_IP], [YOUR_DOMAIN] and server port to your own

You save my life!

<!-- gh-comment-id:1778792269 --> @WannaYoung commented on GitHub (Oct 25, 2023): > @wbrione bro i solved this problem :) maybe help. Add “Custom Nginx Configuration", no other changes are needed. > > ``` > location / > { > proxy_pass http://[YOUR_SERVER_IP]:9901; > proxy_set_header Host [YOUR_DOMAIN]:25052; > proxy_set_header X-Real-IP $remote_addr; > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > proxy_set_header REMOTE-HOST $remote_addr; > proxy_set_header Upgrade $http_upgrade; > proxy_set_header Connection "Upgrade"; > proxy_connect_timeout 60; > proxy_send_timeout 90; > proxy_read_timeout 90; > proxy_buffer_size 4k; > proxy_buffers 4 32k; > proxy_busy_buffers_size 64k; > proxy_temp_file_write_size 64k; > add_header X-Cache $upstream_cache_status; > } > ``` > > change the [YOUR_SERVER_IP], [YOUR_DOMAIN] and server port to your own You save my life!
Author
Owner

@github-actions[bot] commented on GitHub (Jun 8, 2024):

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

<!-- gh-comment-id:2155753222 --> @github-actions[bot] commented on GitHub (Jun 8, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
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#1884
No description provided.