NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
23.17k stars 2.68k forks source link

How do you configure redirects just on the local IP address? #3728

Open danielrosehill opened 6 months ago

danielrosehill commented 6 months ago

Hey!

I set up NPM on a Synology NAS for creating a couple of internal redirects to containers.

For instance, it might be nice to redirect:

10.0.0.1/HB

To:

10.0.0.1:3000

Where: 10.0.0.1 = Synology local IP and port 3000 = target service.

I was assuming that something like this would work out of the box but unfortunately not:

image

Is there a best practice for creating this kind of (internal IP) redirect?

hughau commented 6 months ago

What I've done is setup an A record for .int.domain.com (where I own domain.com) to point to my local private IP address (10.0.0.1 in your case), and I also create a wildcard certificate for .internal.domain.com so I can use SSL internally.

Then I can setup different services in NPM to point to internal services - eg https://grafana.int.domain.com might point to the http://10.0.0.20:3030, and optionally use the SSL certificate.

gratiachristi95 commented 6 months ago

This might help: https://askubuntu.com/questions/1370094/is-it-possible-to-alias-a-port-number

However, nginx proxy manager is as far as I know only setup to do domain & subdomain routing. Paths are done on the application side and not on the network side of things.