[GH-ISSUE #1039] Issue with Plex as subfolder requests going to port 4443 #873

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

Originally created by @ZeroTwoCode on GitHub (Apr 25, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1039

Describe the bug

  • NginxProxyManager v2.8.1
  • When setting up Plex as a subfolder, it is requesting assets through port 4443 and these aren't being rewritten correctly. Some requests are successful and some aren't. I have migrated from swag and used the same config except for NPM listens on port 4443 whereas swag was 443.

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;
}
Originally created by @ZeroTwoCode on GitHub (Apr 25, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1039 **Describe the bug** - NginxProxyManager v2.8.1 - When setting up Plex as a subfolder, it is requesting assets through port 4443 and these aren't being rewritten correctly. Some requests are successful and some aren't. I have migrated from swag and used the same config except for NPM listens on port 4443 whereas swag was 443. **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](https://user-images.githubusercontent.com/82778640/116004385-6d5ab400-a5fa-11eb-82d6-b091def75c65.png) Failed request to port 4443 ![Failed Request_1](https://user-images.githubusercontent.com/82778640/116004389-751a5880-a5fa-11eb-80ac-38cc931f2a14.png) **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; } ```
kerem 2026-02-26 06:34:45 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@mgutt commented on GitHub (Jul 9, 2021):

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.

<!-- gh-comment-id:877260451 --> @mgutt commented on GitHub (Jul 9, 2021): 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.
Author
Owner

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

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

<!-- gh-comment-id:1993072363 --> @github-actions[bot] commented on GitHub (Mar 13, 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 25, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2829221108 --> @github-actions[bot] commented on GitHub (Apr 25, 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#873
No description provided.