[GH-ISSUE #2049] Have multiple ip redirects to domain with the same ip? #1481

Closed
opened 2026-02-26 07:31:14 +03:00 by kerem · 5 comments
Owner

Originally created by @HardChalice on GitHub (May 12, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2049

Hey all,

Im using NPM to for a couple of services on a single machine and I can set up SSL fine for my domains. However I want to be able to redirect any <IP>:<Port> requests for these services to their respective domain name. The reason being is I'm using a wildcard cert and when I route over the IP's its unencrypted as the wildcard cert doesn't apply. I could theoretically use LetsEnycrypt but I was hoping to avoid that in this specific case.

I can have a single redirect for a service working where the Domain Name = IP and Forward Domain = Domain with the Advanced section having an Listen 8000. However I can't duplicate this for multiple services on different ports as it says the Domain Name = IP is already in use.

Originally created by @HardChalice on GitHub (May 12, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2049 Hey all, Im using NPM to for a couple of services on a single machine and I can set up SSL fine for my domains. However I want to be able to redirect any `<IP>:<Port>` requests for these services to their respective domain name. The reason being is I'm using a wildcard cert and when I route over the IP's its unencrypted as the wildcard cert doesn't apply. I could theoretically use LetsEnycrypt but I was hoping to avoid that in this specific case. I can have a single redirect for a service working where the `Domain Name = IP` and `Forward Domain = Domain` with the Advanced section having an `Listen 8000`. However I can't duplicate this for multiple services on different ports as it says the `Domain Name = IP` is already in use.
kerem 2026-02-26 07:31:14 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@jtrosper commented on GitHub (May 13, 2022):

Certificates, even wildcards, are only valid when called upon by a browser in reference to a targeted domain. The certificate is issued for the domain, and the IP address is not a part of that domain.

Is there something preventing you from creating subdomains with CNAME DNS records and pointing those at your individual proxy hosts?

<!-- gh-comment-id:1125698634 --> @jtrosper commented on GitHub (May 13, 2022): Certificates, even wildcards, are only valid when called upon by a browser in reference to a targeted domain. The certificate is issued for the domain, and the IP address is not a part of that domain. Is there something preventing you from creating subdomains with CNAME DNS records and pointing those at your individual proxy hosts?
Author
Owner

@HardChalice commented on GitHub (May 13, 2022):

The issue isn't creating sub domains, its mapping the server IP to the multiple sub domains. Nginx Proxy Manager will only let me specify the server IP once in the redirect setup even though I have multiple services running on the same IP.

For example redirect from Server_IP:3000 -> subdomain1 works (with advanced config to listen on port 3000). However I can't create Server_IP:3001 -> subdomain2 because Server_IP is already in use.

<!-- gh-comment-id:1126144833 --> @HardChalice commented on GitHub (May 13, 2022): The issue isn't creating sub domains, its mapping the server IP to the multiple sub domains. Nginx Proxy Manager will only let me specify the server IP once in the redirect setup even though I have multiple services running on the same IP. For example redirect from `Server_IP:3000 -> subdomain1` works (with advanced config to listen on port 3000). However I can't create `Server_IP:3001 -> subdomain2` because `Server_IP` is already in use.
Author
Owner

@the1ts commented on GitHub (May 22, 2022):

I think you'll have to do an IP based host and multiple listen lines for all the ports wanted and then multiple return url lines dependent on port in the advanced config.

if ($server_port = 3000) {
        rewrite ^ https:/domain1.example.com/$request_uri permanent;
}
if ($server_port = 3001) {
        rewrite ^ https:/domain2.example.com/$request_uri permanent;
}

but putting that behind SSL is another matter, letsencrypt does not allow certs for IPs and many CAs don't either. Its a hack, what is hard coded to use ip:port that can't be changed? This feels like going back 30 years with people ignoring DNS.

<!-- gh-comment-id:1133993031 --> @the1ts commented on GitHub (May 22, 2022): I think you'll have to do an IP based host and multiple listen lines for all the ports wanted and then multiple return url lines dependent on port in the advanced config. ``` if ($server_port = 3000) { rewrite ^ https:/domain1.example.com/$request_uri permanent; } if ($server_port = 3001) { rewrite ^ https:/domain2.example.com/$request_uri permanent; } ``` but putting that behind SSL is another matter, letsencrypt does not allow certs for IPs and many CAs don't either. Its a hack, what is hard coded to use ip:port that can't be changed? This feels like going back 30 years with people ignoring DNS.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 17, 2024):

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

<!-- gh-comment-id:1949585814 --> @github-actions[bot] commented on GitHub (Feb 17, 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 2, 2025):

Issue was closed due to inactivity.

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