Skip to content

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

@Hanarion

Description

@Hanarion

Describe the bug

  • When the port used for reverse proxy is not 443 or 80 websockets doesnt works

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions