[GH-ISSUE #2218] NPM doesn´t redirect when url has HTTPS in local domains #1585

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

Originally created by @miguelcabanes on GitHub (Aug 24, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2218

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug
I have Pihole with Local DNS Records:

  1. portainer.home, ip 192.168.1.102, url -> https://192.168.1.102:9443
  2. truenas.home, ip 192.168.1.100, url -> http://192.168.1.100:80
  3. proxmox.home, ip 192.168.1.99, url -> https://192.168.1.99:8006
  4. manager.home, ip 192.168.1.104, url -> http://192.168.1.104:81

When I add Proxy Host in NPM I do this...
image
image

The problem is that NPM does not redirect me correctly when it is https and when it is http it does it correctly, even though the http port is not 80 (also with 81). It is as if when the url has https it does not hook the port to do the redirection correctly. This does not happen with urls with http (regardless of any port)

So manager.home and truenas.home goes OK, but proxmox.home and portainer.home goes wrong.

There is one thing that seems strange to me and that is that if I add to my windows 10 hosts file the domains that do not work (proxmox.home and portainer.home pointing to the npm ip) and try again, this time NPM adds the port to the browser url and then it works.

There is some Custom Nginx Configuration to add in Proxy Host to force adding the port to url?

Thanks

Nginx Proxy Manager Version
v2.9.18

Expected behavior
Navigate though all urls without problem

Operating System
LXC with Ubuntu in Proxmox server

Originally created by @miguelcabanes on GitHub (Aug 24, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2218 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes **Describe the bug** I have Pihole with Local DNS Records: 1. portainer.home, ip 192.168.1.102, url -> https://192.168.1.102:9443 2. truenas.home, ip 192.168.1.100, url -> http://192.168.1.100:80 3. proxmox.home, ip 192.168.1.99, url -> https://192.168.1.99:8006 4. manager.home, ip 192.168.1.104, url -> http://192.168.1.104:81 When I add Proxy Host in NPM I do this... ![image](https://user-images.githubusercontent.com/18458247/186379344-ed08ffc2-5e8b-4db2-84bf-936222cf66f8.png) ![image](https://user-images.githubusercontent.com/18458247/186379462-448a19ff-7c25-4d6e-82c4-527780ce2243.png) The problem is that NPM does not redirect me correctly when it is https and when it is http it does it correctly, even though the http port is not 80 (also with 81). It is as if when the url has https it does not hook the port to do the redirection correctly. This does not happen with urls with http (regardless of any port) So manager.home and truenas.home goes OK, but proxmox.home and portainer.home goes wrong. There is one thing that seems strange to me and that is that if I add to my windows 10 hosts file the domains that do not work (proxmox.home and portainer.home pointing to the npm ip) and try again, this time NPM adds the port to the browser url and then it works. There is some Custom Nginx Configuration to add in Proxy Host to force adding the port to url? Thanks **Nginx Proxy Manager Version** v2.9.18 **Expected behavior** Navigate though all urls without problem **Operating System** LXC with Ubuntu in Proxmox server
kerem 2026-02-26 07:31:39 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@the1ts commented on GitHub (Aug 24, 2022):

Am I reading correctly? you are pointing portainer.home at the portainer IP rather than the NPM IP?

<!-- gh-comment-id:1225712970 --> @the1ts commented on GitHub (Aug 24, 2022): Am I reading correctly? you are pointing portainer.home at the portainer IP rather than the NPM IP?
Author
Owner

@miguelcabanes commented on GitHub (Aug 24, 2022):

Am I reading correctly? you are pointing portainer.home at the portainer IP rather than the NPM IP?

Yes.

It works fine when I put in the pihole the ip of the NPM (192.168.1.104) for portainer.home (currently 192.168.1.102) as you want to imply and it is correct. The problem is that if I do nslookup to portainer.home I need the ip that resolves to me not to be the one from NPM (192.168.1.104) but the real one from portainer.home (192.168.1.102). I can't think of any other way to make it work.

I hope I have explained myself well.

Thank you very much

<!-- gh-comment-id:1226357426 --> @miguelcabanes commented on GitHub (Aug 24, 2022): > Am I reading correctly? you are pointing portainer.home at the portainer IP rather than the NPM IP? Yes. It works fine when I put in the pihole the ip of the NPM (192.168.1.104) for portainer.home (currently 192.168.1.102) as you want to imply and it is correct. The problem is that if I do nslookup to portainer.home I need the ip that resolves to me not to be the one from NPM (192.168.1.104) but the real one from portainer.home (192.168.1.102). I can't think of any other way to make it work. I hope I have explained myself well. Thank you very much
Author
Owner

@the1ts commented on GitHub (Aug 24, 2022):

I asked my question because the IP for connecting to portainer via NPM has to be the IP of NPM.
It sounds currently like you have NPM setup on one IP, but are connecting directly to the IPs of the services NPM is trying to proxy for. In short, NPM is never in the equation when you are hitting working or not working hostnames you mention above.

<!-- gh-comment-id:1226457494 --> @the1ts commented on GitHub (Aug 24, 2022): I asked my question because the IP for connecting to portainer via NPM **has to be** the IP of NPM. It sounds currently like you have NPM setup on one IP, but are connecting directly to the IPs of the services NPM is trying to proxy for. In short, NPM is never in the equation when you are hitting working or not working hostnames you mention above.
Author
Owner

@miguelcabanes commented on GitHub (Aug 24, 2022):

Ok, thanks for the clarification I think I have to think of a better way to do it. Surely it is not necessary that in my NPM I have my local domains (portainer.home, proxmox.home). I think it is not useful to me in any way.

Thanks for everything

<!-- gh-comment-id:1226540997 --> @miguelcabanes commented on GitHub (Aug 24, 2022): Ok, thanks for the clarification I think I have to think of a better way to do it. Surely it is not necessary that in my NPM I have my local domains (portainer.home, proxmox.home). I think it is not useful to me in any way. Thanks for everything
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#1585
No description provided.