• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Help with Nginx Reverse Proxy

Joined
Jul 24, 2021
Messages
63 (0.05/day)
Hello everyone!

I just setup a simple home server with Open Media Vault 7 (OMV) and I managed to installed Pi-hole as DHCP and DNS server. The Pi-hole container is running on a separate macvlan network while all other services are running on the default docker network, including Nginx Reverse Proxy. Everything is working fine, I setup the DNS names in Pi-hole and direct everything not on port 80 to nginx service ip, and the pages load correctly.

The nginx sever is at 192.168.0.10. It's very simple to serve any port in this address, but I cannot find a way to serve a port in a different IP address. For example, I have and FTP server running on IP 192.168.0.155:5000, how can I redirect this from nginx? In pihole I set up the DNS as ftp.lan - 192.168.0.10. Then in nginx WebUI I configured as follows:
1742848171763.png


When I try to access http://ftp.lan I end in nginx home page:
1742847926581.png


A second point, is it possible to redirect to a path? For example, pihole.lan takes me to pihole page, but not the admin one. I need to add /admin at the address. This is not a problem, but if I could write pihole.lan and go direct to pihole.lan/admin would be great.

I'm not posting my docker files, but if need be I post them.

Thanks in advance.
 

Attachments

  • 1742847878044.png
    1742847878044.png
    47.4 KB · Views: 23

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
27,522 (3.84/day)
Location
Alabama
System Name RogueOne
Processor Xeon W9-3495x
Motherboard ASUS w790E Sage SE
Cooling SilverStone XE360-4677
Memory 128gb Gskill Zeta R5 DDR5 RDIMMs
Video Card(s) MSI SUPRIM Liquid X 4090
Storage 1x 2TB WD SN850X | 2x 8TB GAMMIX S70
Display(s) 49" Philips Evnia OLED (49M2C8900)
Case Thermaltake Core P3 Pro Snow
Audio Device(s) Moondrop S8's on schitt Gunnr
Power Supply Seasonic Prime TX-1600
Mouse Razer Viper mini signature edition (mercury white)
Keyboard Monsgeek M3 Lavender, Moondrop Luna lights
VR HMD Quest 3
Software Windows 11 Pro Workstation
Benchmark Scores I dont have time for that.
You need to redirect the ports as well. Nginx isnt the only component, you need to make sure there is a forward rule in your router also to your nginx proxy. I'm only covering that for now because I dont have time to read this and there are several problems all at once.
 
Joined
Jul 24, 2021
Messages
63 (0.05/day)
Even if I'm using pihole as DHCP I need to forward rules on my router? When you have the time I would appreciate if you could get into more details. I'm a beginner when it comes to networking.

I'm not sure if it is clear in the first image, but I'm setting the port as well: 5000
 

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
27,522 (3.84/day)
Location
Alabama
System Name RogueOne
Processor Xeon W9-3495x
Motherboard ASUS w790E Sage SE
Cooling SilverStone XE360-4677
Memory 128gb Gskill Zeta R5 DDR5 RDIMMs
Video Card(s) MSI SUPRIM Liquid X 4090
Storage 1x 2TB WD SN850X | 2x 8TB GAMMIX S70
Display(s) 49" Philips Evnia OLED (49M2C8900)
Case Thermaltake Core P3 Pro Snow
Audio Device(s) Moondrop S8's on schitt Gunnr
Power Supply Seasonic Prime TX-1600
Mouse Razer Viper mini signature edition (mercury white)
Keyboard Monsgeek M3 Lavender, Moondrop Luna lights
VR HMD Quest 3
Software Windows 11 Pro Workstation
Benchmark Scores I dont have time for that.
that is only half the problem. Are you only touching these from your LAN? or do you expect to access them from outside your network?

That page indicates its working to me. You havent told us what your expecting. Is there some kind of web gui for your ftp app on 5000? What does it look like when you manually go to it raw?
 
Joined
Jul 24, 2021
Messages
63 (0.05/day)
Sorry for the delay, was taking care of my daughter.

For the foreseeable future I just want to access my services from my LAN.

I just setup a simple hello world container (image) that is on the macvlan. Address: 192.168.0.199:8000

If I go to http://192.168.0.199:8000 it works as expected.

On pihole I added a new DNS entry hello.lan -> 192.168.0.10 (nginx ip)
On nginx I did as below:
1742860911034.png


When I access http://hello.lan I receive [504] Gateway Timeout.

I did not configured anything else.
 
Joined
Dec 8, 2021
Messages
26 (0.02/day)
Sorry, silly sanity check question, but does proxy hosts only do http/https traffic?

Is what you are looking to do a "Stream" proxy?
 

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
27,522 (3.84/day)
Location
Alabama
System Name RogueOne
Processor Xeon W9-3495x
Motherboard ASUS w790E Sage SE
Cooling SilverStone XE360-4677
Memory 128gb Gskill Zeta R5 DDR5 RDIMMs
Video Card(s) MSI SUPRIM Liquid X 4090
Storage 1x 2TB WD SN850X | 2x 8TB GAMMIX S70
Display(s) 49" Philips Evnia OLED (49M2C8900)
Case Thermaltake Core P3 Pro Snow
Audio Device(s) Moondrop S8's on schitt Gunnr
Power Supply Seasonic Prime TX-1600
Mouse Razer Viper mini signature edition (mercury white)
Keyboard Monsgeek M3 Lavender, Moondrop Luna lights
VR HMD Quest 3
Software Windows 11 Pro Workstation
Benchmark Scores I dont have time for that.
Sorry for the delay, was taking care of my daughter.

For the foreseeable future I just want to access my services from my LAN.

I just setup a simple hello world container (image) that is on the macvlan. Address: 192.168.0.199:8000

If I go to http://192.168.0.199:8000 it works as expected.

On pihole I added a new DNS entry hello.lan -> 192.168.0.10 (nginx ip)
On nginx I did as below:
View attachment 391385

When I access http://hello.lan I receive [504] Gateway Timeout.

I did not configured anything else.

whats in custom and advanced? this is "nginx proxy manager" not "nginx".

My nginx (disabled sites) looks like this for comparison:

1742863528606.png



when it redirects you "properly" when you type it raw what does the url say? is it appending httpS?
 
Last edited:
Joined
Jul 24, 2021
Messages
63 (0.05/day)
Sorry, silly sanity check question, but does proxy hosts only do http/https traffic?

Is what you are looking to do a "Stream" proxy?
I'm not sure I understand your question. I'll try to explain what I'm looking for: I want the proxy manager to forward the URL's to the proper addresses. When the container is in the same IP as NPM it redirects (is this term correct?) to the expected port. When the container is in another IP address it does not. That's it. About the http/https traffic I think so. I do not have https enabled (yet), I'm trying to figure out the simpler parts first. All of this is in the name of convenience and learning.


whats in custom and advanced? this is "nginx proxy manager" not "nginx".
I was using nginx for the sake of brevity, but I'll use NPM going forward. In the other tabs I have this:

1742905577465.png
1742905593105.png
1742905615693.png

My nginx (disabled sites) looks like this for comparison:

View attachment 391388


when it redirects you "properly" when you type it raw what does the url say? is it appending httpS?
When I type http://hello.lan it does not append https. Same when I use the IP + port. I have not used https in anywhere in my server yet.

I found this other two options on NPM. Redirection Host:
1742916445185.png

And Stream (I think this has something to do with what @IMABEARLOL was asking me0:
1742916521232.png
 
Top