NginxProxyManager / nginx-proxy-manager

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

Websocket support for another port than default (with fix) #586

Open Hanarion opened 4 years ago

Hanarion commented 4 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Map another port that 443 or 80 on the host side to the docker container
  2. try to connect to a websocket
  3. you'll get a 403 error

Expected behavior Working websocket

Solution Change code of include/proxy.conf to :

add_header       X-Served-By $http_host;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto  $scheme;
proxy_set_header X-Forwarded-For    $remote_addr;
proxy_pass       $forward_scheme://$server:$port;

$host is changed to $http_host in order to fix that problem

luastoned commented 3 years ago

I think this issue is still ongoing?

thorsten-gehrig commented 2 years ago

I´m also looking forward to have a fix for this. My Websocket is on port 8080....

github-actions[bot] commented 7 months ago

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