NginxProxyManager / nginx-proxy-manager

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

Issue with Plex as subfolder requests going to port 4443 #1039

Open ZeroTwoCode opened 3 years ago

ZeroTwoCode commented 3 years ago

Describe the bug

To Reproduce

  1. Set up Plex as subfolder
  2. Go to https://yourdomainname/plex
  3. Check network activity to see failed requests to port 4443

Expected behavior The requests to port 4443 should be rewritten to port 443.

Screenshots Successful request to port 443 Successful Request_1

Failed request to port 4443 Failed Request_1

Config

location /plex {
    return 301 $scheme://$host/plex/;
}
if ($http_referer ~* /plex) {
    rewrite ^/web/(.*) /plex/web/$1? redirect;
}

location ^~ /plex/ {
    proxy_set_header Host $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       http://192.168.1.2:32400;

    rewrite /plex(.*) $1 break;

    proxy_set_header X-Plex-Client-Identifier $http_x_plex_client_identifier;
    proxy_set_header X-Plex-Device $http_x_plex_device;
    proxy_set_header X-Plex-Device-Name $http_x_plex_device_name;
    proxy_set_header X-Plex-Platform $http_x_plex_platform;
    proxy_set_header X-Plex-Platform-Version $http_x_plex_platform_version;
    proxy_set_header X-Plex-Product $http_x_plex_product;
    proxy_set_header X-Plex-Token $http_x_plex_token;
    proxy_set_header X-Plex-Version $http_x_plex_version;
    proxy_set_header X-Plex-Nocache $http_x_plex_nocache;
    proxy_set_header X-Plex-Provides $http_x_plex_provides;
    proxy_set_header X-Plex-Device-Vendor $http_x_plex_device_vendor;
    proxy_set_header X-Plex-Model $http_x_plex_model;
}
mgutt commented 3 years ago

NPM does not listen to any other ports than 80 and 443. Try to add this to the advanced settings to enable 4443 as well:

listen 4443;

But I suggest to change everything to 443 as you can't forward ports with IPv6.

github-actions[bot] commented 6 months ago

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