Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
Nginx Plugin Reverse Proxy for sub-domains
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nginx Plugin Reverse Proxy for sub-domains (Read 6605 times)
CaptainSandwich
Newbie
Posts: 4
Karma: 0
Nginx Plugin Reverse Proxy for sub-domains
«
on:
March 15, 2020, 08:08:03 am »
Hi all,
I currently have nginx running on a home server within my network to serve as a reverse proxy, directing subdomains like emby.mydomain.com to an internal IP and port combination. I'm now looking to make use of the nginx plugin within opnsense to serve the same function, though I'm having a bit of a hard time going from the nginx.conf to a gui configuration in the plugin.
Specifically, I don't seem to be able to get subdomains to direct correctly. As I mentioned, I'm trying to get emby.mydomain.com to redirect, however it just times out. Navigating to just mydomain.com however loads emby, as does the IP of the opnsense router (opnsense webgui is running on port 8080). I've followed through the how to, but I'm not really sure where I'm going wrong or why this isn't working. Could someone please have a look over the below steps I've taken and give any pointers? Thank you very much.
All defaults where not specified
Upstream Server
Description: Emby Server
Server: 192.168.0.100
Port: 8096
Server Priority: 1
Upstream
Description: Emby Upstream
Server Entries: Emby Server
Location
Description: Emby Location
URL Pattern: /
Upstream Servers: Emby Upstream
HTTP Server
Server Name: emby.mydomain.com
Locations: Emby Location
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #1 on:
March 15, 2020, 08:50:00 am »
Timeout is usually a sign that you either have to reload nginx or are missing a firewall rule to allow the traffic.
Logged
CaptainSandwich
Newbie
Posts: 4
Karma: 0
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #2 on:
March 15, 2020, 09:15:05 am »
Hi Fabian,
I'm not sure it's either. Being able to load emby by navigating to mydomain.com, I assume the firewall rules I have added are working (Port 80 and 443 passed to
this firewall
via WAN interface). Port 8096 is not forwarded so emby shouldn't be accessible without nginx running, and indeed is not when the service is stopped.
Logged
CaptainSandwich
Newbie
Posts: 4
Karma: 0
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #3 on:
March 29, 2020, 01:17:04 pm »
Should the below configuration be working as I expect it to, emby.mydomain.com -> 192.168.0.100:8096, or is there something fundamentally wrong with my config?
Upstream Server
Description: Emby Server
Server: 192.168.0.100
Port: 8096
Server Priority: 1
Upstream
Description: Emby Upstream
Server Entries: Emby Server
Location
Description: Emby Location
URL Pattern: /
Upstream Servers: Emby Upstream
HTTP Server
Server Name: emby.mydomain.com
Locations: Emby Location
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #4 on:
March 29, 2020, 04:56:29 pm »
That should work.
Logged
CaptainSandwich
Newbie
Posts: 4
Karma: 0
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #5 on:
March 30, 2020, 07:24:14 am »
Thanks Fabian, I'll keep poking around to see what else might be causing the problem.
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx Plugin Reverse Proxy for sub-domains
«
Reply #6 on:
March 30, 2020, 06:38:58 pm »
If you try HTTPS, have you set up a certificate? Otherwise HTTPS will not be configured.
Also: is the status icon green?
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
Nginx Plugin Reverse Proxy for sub-domains