[GH-ISSUE #4315] Unconventional ports, redirection lost port problem!!! #2774

Open
opened 2026-02-26 07:36:45 +03:00 by kerem · 2 comments
Owner

Originally created by @lizheyo77 on GitHub (Jan 22, 2025).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4315

if (-d $request_filename) {
rewrite [^/]$ $scheme://$http_host$uri/ permanent;
}
How to add to Nginx Proxy Manager

My website is https://www.ao1xxx.com:5421, and there is a webpage below it is https://www.ao1xxx.com:5421/logs/. If I visit https://www.ao1xxx.com:5421/logs, it will be directly inaccessible, and then the website will become www.ao1xxx.com/logs/, my 5421 port will be lost, resulting in access failure. Please help me

npm version v2.12.2

Originally created by @lizheyo77 on GitHub (Jan 22, 2025). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/4315 if (-d $request_filename) { rewrite [^/]$ $scheme://$http_host$uri/ permanent; } How to add to Nginx Proxy Manager My website is https://www.ao1xxx.com:5421, and there is a webpage below it is https://www.ao1xxx.com:5421/logs/. If I visit https://www.ao1xxx.com:5421/logs, it will be directly inaccessible, and then the website will become www.ao1xxx.com/logs/, my 5421 port will be lost, resulting in access failure. Please help me npm version v2.12.2
Author
Owner

@edsonsbj commented on GitHub (Feb 12, 2025):

Friend, I racked my brains over this for a long time until I found it on a forum, I don't know where else, all you need to do is edit your proxy host in the custom locations tab, you leave it like the image below.

Image

proxy_set_header X-Forwarded-Host $http_host;
proxy_cookie_path / "/; Secure";

<!-- gh-comment-id:2652579567 --> @edsonsbj commented on GitHub (Feb 12, 2025): Friend, I racked my brains over this for a long time until I found it on a forum, I don't know where else, all you need to do is edit your proxy host in the custom locations tab, you leave it like the image below. ![Image](https://github.com/user-attachments/assets/dbf1ad4f-d7ed-437f-a2b9-e9ea34d4a44d) proxy_set_header X-Forwarded-Host $http_host; proxy_cookie_path / "/; Secure";
Author
Owner

@github-actions[bot] commented on GitHub (Aug 25, 2025):

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

<!-- gh-comment-id:3218614703 --> @github-actions[bot] commented on GitHub (Aug 25, 2025): 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#2774
No description provided.