mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #2969] Change NPM Listen port based on Proxy Host #2020
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#2020
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CrazyVaclav on GitHub (May 31, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2969
Hi, I have two proxy hosts in my NPM docker container:
I.) Public Website and therefore Port 80 and 443 should be used for NPM to listen on and forward to port 80 of the target HTTP Joomla app. I want that this app is accessible with port 80 and 443
II.) Private self build web app that only I will access. I want that this second proxy host is ONLY accessible via Port 8443
In my docker compose file I created a Host:Container Mapping for all three ports:
What I can do so far is add

listen 8443 ssl http2;to the Advanced Tab in the target proxy host number IIThat opens up Port 8443 for the proxy host number I and II.
and Port 443 is still open for proxy host number I and II.
Is there a way to change the default 443/80 listen ports of NPM ONLY for proxy host number II ?
@zer0brain commented on GitHub (Aug 29, 2023):
I have exactly the same issue, its possible to remove 80/443 in the XX.conf file manual. then just change a different config to restart nginx, but will be added from ui again after some changes on the host config. so its not really a persistent solution.
it would be really nice to have the option to comment out the default listening in a config by a checkbox/switch, to be able to listen only on custom ports inside the advanced config and not the default 80/443 set.
@zer0brain commented on GitHub (Aug 29, 2023):
So i found meanwhile a workaround to make it persistent.
Iadded an additional mount point for the /app/template Folder
Then added the content Manual from here: https://github.com/NginxProxyManager/nginx-proxy-manager/tree/develop/backend/templates
then change the template _listen.conf added # everywhere to not listen on anything in any case.
now in every new confing the default listen will be commented out, and you have to manually add it in the advanced config.
or in you case:
listen 8443 ssl;this makes the http2 and SSL switches in the UI kinda useless and is more Work but its Persistent.
@davmc123 commented on GitHub (Feb 19, 2024):
I'm trying to make the custom listening port work with WebSockets but the default toggle in the UI does not work. Any idea what I need to add to the advanced configuration?
@naterfute commented on GitHub (Jun 8, 2024):
Alright, I don't want to revive a dead post, but I tried this and it worked. Sort of, it forwarded it to my port, but it's not ssl secured?
@github-actions[bot] commented on GitHub (Jan 10, 2025):
Issue is now considered stale. If you want to keep it open, please comment 👍
@wzwtt commented on GitHub (Nov 27, 2025):
My current solution is to replace all instances of 80/443 in the .conf files within the source code and then rebuild the image.