[GH-ISSUE #1775] How to listen to other port than 80/443 #1316

Open
opened 2026-02-26 07:30:28 +03:00 by kerem · 15 comments
Owner

Originally created by @eranwo on GitHub (Jan 19, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1775

Hi,
First I want to thank the developers for this wonderful project.
Is it possible to make a redirect of domain listen in other port then 80/443?
I mean in case that we need to redirect
domain.com:7007 to domain2.com (and secure the port 7007)
This is useful for example for Internet radio stations that used to broadcast on port other than port 80 and want to maintain the structure of their stream URL.

Originally created by @eranwo on GitHub (Jan 19, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1775 Hi, First I want to thank the developers for this wonderful project. Is it possible to make a redirect of domain listen in other port then 80/443? I mean in case that we need to redirect `domain.com:7007` to `domain2.com` (and secure the port 7007) This is useful for example for Internet radio stations that used to broadcast on port other than port 80 and want to maintain the structure of their stream URL.
Author
Owner

@lieven121 commented on GitHub (Feb 20, 2022):

Hi if you want to receive traffic on another port e.g. 7007 you can portforward that port (either in docker or in your firewall)

for in docker
image
here you would need the first 80 or the first 443 to 7007 depending if the connection is https
e.g
7007:80

then in NPM
image
place here domain2.com and use port 443

Also please change the tag to Question, this is not a bug

Kind regards

<!-- gh-comment-id:1046185420 --> @lieven121 commented on GitHub (Feb 20, 2022): Hi if you want to receive traffic on another port e.g. 7007 you can portforward that port (either in docker or in your firewall) for in docker ![image](https://user-images.githubusercontent.com/7773244/154834099-01d2b1ec-cbe9-4152-aec0-61e51c6ad767.png) here you would need the first 80 or the first 443 to 7007 depending if the connection is https e.g 7007:80 then in NPM ![image](https://user-images.githubusercontent.com/7773244/154834238-471d89aa-eda0-41c8-93d6-08292220de1f.png) place here domain2.com and use port 443 Also please change the tag to Question, this is not a bug Kind regards
Author
Owner

@eranwo commented on GitHub (Feb 28, 2022):

Thanks @lieven121
BTW, I'm not sure that I can change the label from bug to question.
Could you explain how?

<!-- gh-comment-id:1054295013 --> @eranwo commented on GitHub (Feb 28, 2022): Thanks @lieven121 BTW, I'm not sure that I can change the label from bug to question. Could you explain how?
Author
Owner

@cn-ml commented on GitHub (Jun 9, 2022):

I think I'm facing a similar problem as @eranwo

I want to reverse proxy multiple services on default port 443, but i additionally want to host a matrix federation server that requires me to listen to external port 8448. So for some proxy hosts, i.e. portainer.mydomain.tld i need to listen to 80 and 443, but for matrix.mydomain.tld:8448 i want to listen to 8448 as an ssl port. I am not sure how to achieve this. Is it possible to use the existing proxy host configuration but adding a listen directive in the custom configuration field?

<!-- gh-comment-id:1150876632 --> @cn-ml commented on GitHub (Jun 9, 2022): I think I'm facing a similar problem as @eranwo I want to reverse proxy multiple services on default port 443, but i additionally want to host a matrix federation server that requires me to listen to external port 8448. So for some proxy hosts, i.e. portainer.mydomain.tld i need to listen to 80 and 443, but for matrix.mydomain.tld:8448 i want to listen to 8448 as an ssl port. I am not sure how to achieve this. Is it possible to use the existing proxy host configuration but adding a listen directive in the custom configuration field?
Author
Owner

@0chroma commented on GitHub (Sep 17, 2022):

I think I'm facing a similar problem as @eranwo

I want to reverse proxy multiple services on default port 443, but i additionally want to host a matrix federation server that requires me to listen to external port 8448. So for some proxy hosts, i.e. portainer.mydomain.tld i need to listen to 80 and 443, but for matrix.mydomain.tld:8448 i want to listen to 8448 as an ssl port. I am not sure how to achieve this. Is it possible to use the existing proxy host configuration but adding a listen directive in the custom configuration field?

you can create a forward host with the port included in the domain name (matrix.mydomain.tld:8448) in your case and add this to the custom nginx config tab: listen 8448 ssl default_server;

I'm surprised this isn't done automatically

<!-- gh-comment-id:1250067006 --> @0chroma commented on GitHub (Sep 17, 2022): > I think I'm facing a similar problem as @eranwo > > I want to reverse proxy multiple services on default port 443, but i additionally want to host a matrix federation server that requires me to listen to external port 8448. So for some proxy hosts, i.e. portainer.mydomain.tld i need to listen to 80 and 443, but for matrix.mydomain.tld:8448 i want to listen to 8448 as an ssl port. I am not sure how to achieve this. Is it possible to use the existing proxy host configuration but adding a listen directive in the custom configuration field? you can create a forward host with the port included in the domain name (matrix.mydomain.tld:8448) in your case and add this to the custom nginx config tab: `listen 8448 ssl default_server;` I'm surprised this isn't done automatically
Author
Owner

@gunsar commented on GitHub (May 8, 2023):

I tried using the stream menu in the proxy manager adding listen port 8400 tcp udp, the result is:
http://domain.tld:8400 (non ssl, running normally)
https://domain.tld:8400 (ssl, not running)
how to make ssl url work well?

<!-- gh-comment-id:1538628029 --> @gunsar commented on GitHub (May 8, 2023): I tried using the stream menu in the proxy manager adding listen port 8400 tcp udp, the result is: http://domain.tld:8400 (non ssl, running normally) https://domain.tld:8400 (ssl, not running) how to make ssl url work well?
Author
Owner

@zer0brain commented on GitHub (Aug 29, 2023):

you can try using my workaround to use custom ports for host without default:
https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2969

<!-- gh-comment-id:1697744244 --> @zer0brain commented on GitHub (Aug 29, 2023): you can try using my workaround to use custom ports for host without default: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2969
Author
Owner

@Technerd-SG commented on GitHub (Feb 23, 2024):

Is this something that is been worked on?
DSM (Synology Nas) does it like this:
grafik
Could something like this be implemented?
Thanks for the awsome work done here!

<!-- gh-comment-id:1962019274 --> @Technerd-SG commented on GitHub (Feb 23, 2024): Is this something that is been worked on? DSM (Synology Nas) does it like this: ![grafik](https://github.com/NginxProxyManager/nginx-proxy-manager/assets/116316180/0468b455-cb53-4fdc-9639-69273a6d4d28) Could something like this be implemented? Thanks for the awsome work done here!
Author
Owner

@github-actions[bot] commented on GitHub (Oct 5, 2024):

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

<!-- gh-comment-id:2394861105 --> @github-actions[bot] commented on GitHub (Oct 5, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@RuStyC0der commented on GitHub (Oct 21, 2024):

I want to keep it open) It would be great to be able to set custom external ports for proxy manager

<!-- gh-comment-id:2425827983 --> @RuStyC0der commented on GitHub (Oct 21, 2024): I want to keep it open) It would be great to be able to set custom external ports for proxy manager
Author
Owner

@rescenic commented on GitHub (Jan 6, 2025):

So sad, it doesn't support custom port for virtualhost.

<!-- gh-comment-id:2573882701 --> @rescenic commented on GitHub (Jan 6, 2025): So sad, it doesn't support custom port for virtualhost.
Author
Owner

@Surrogard commented on GitHub (Apr 10, 2025):

Is it generally possible to change the external ports of npm? I know I can change the ports in the docker compose and that is working fine so far but if I want to enable ssl certbot is failing with the challenge because it tells letsencrypt to download the challenge files from port 80.

<!-- gh-comment-id:2791763876 --> @Surrogard commented on GitHub (Apr 10, 2025): Is it generally possible to change the external ports of npm? I know I can change the ports in the docker compose and that is working fine so far but if I want to enable ssl certbot is failing with the challenge because it tells letsencrypt to download the challenge files from port 80.
Author
Owner

@Technerd-SG commented on GitHub (Jun 12, 2025):

Yea it shouldn't be so hard to implement

<!-- gh-comment-id:2968235866 --> @Technerd-SG commented on GitHub (Jun 12, 2025): Yea it shouldn't be so hard to implement
Author
Owner

@dustojnikhummer commented on GitHub (Jul 16, 2025):

I still think this is relevant. I would like to run it in Podman in Host mode, but i had to lower privileged ports down to 80, since NPM has no way to run (internally, not via external Docker/Podman port mapping) on higher ports.

Hell, I think it should be higher by default, internally.

<!-- gh-comment-id:3079514361 --> @dustojnikhummer commented on GitHub (Jul 16, 2025): I still think this is relevant. I would like to run it in Podman in Host mode, but i had to lower privileged ports down to 80, since NPM has no way to run (internally, not via external Docker/Podman port mapping) on higher ports. Hell, I think it should be higher by default, internally.
Author
Owner

@RuStyC0der commented on GitHub (Jul 17, 2025):

Guys, I think I found a solution, well, for some of us at least. Solution is to create streams:

Image

I have one host for my smarthome server which is accessible at port 80/443 added as regular proxy host

and I just added stream for port I need, for destination I set NPM host address itself and for incoming port I set port I need NPM to listen to

Image

it works like this:

Image

As a bonus you still be able to issue/renew Let's encrypt certs

There may be issue with ssl redirects, since it will try to redirect you to port 443 anyway

<!-- gh-comment-id:3084266960 --> @RuStyC0der commented on GitHub (Jul 17, 2025): Guys, I think I found a solution, well, for some of us at least. Solution is to create streams: <img width="1353" height="389" alt="Image" src="https://github.com/user-attachments/assets/34235d1e-b0c2-47ee-90c0-7af9b625c082" /> I have one host for my smarthome server which is accessible at port 80/443 added as regular proxy host and I just added stream for port I need, for destination I set NPM host address itself and for incoming port I set port I need NPM to listen to <img width="1334" height="284" alt="Image" src="https://github.com/user-attachments/assets/1943b494-d6e8-4bb0-be51-5e39690e95f9" /> it works like this: <img width="2051" height="1066" alt="Image" src="https://github.com/user-attachments/assets/0dbdc350-f4d2-4930-a267-26117a9013e9" /> As a bonus you still be able to issue/renew Let's encrypt certs There may be issue with ssl redirects, since it will try to redirect you to port 443 anyway
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

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

<!-- gh-comment-id:3808574287 --> @github-actions[bot] commented on GitHub (Jan 28, 2026): 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#1316
No description provided.