OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: rafnizw on March 11, 2020, 08:09:11 AM

Title: Nginx revers proxy
Post by: rafnizw on March 11, 2020, 08:09:11 AM
I have latest VM OpnSense with Nginx plugin installed and I want to configure revers proxy that forwards traffic based on fqdn to my internal servers
Wifi Clients >>>> OpnSense >>> Internal Serwers
I need OpnSense to listen on ports 80 and 443 but on different IP than internal interface
Can someone show me examples how to configure that

Thanks,
Rafal

Title: Re: Nginx revers proxy
Post by: fabian on March 11, 2020, 05:53:23 PM
Sorry, I cannot follow you. It is bound to all IP addresses so it will listen on everything. Did you forget to add a pass rule on WAN?
Title: Re: Nginx revers proxy
Post by: rafnizw on March 11, 2020, 09:57:43 PM
I do not have problems with the FW rules I just need advice how to configure NGINX plugin.
So lets say I have following scenarios
Guest connect to Wifi AP and this AP is connected to OpnSense interface called Exteral
On this Exteral I need NGINX to listen only on ports 80 and 443 other must be blocked
From the other side OpnSense is connected to LAN interface called Internal
What I need is
if Guest types FQDN 1 dns points to OpnSense Exteral IP
Based on FQDN, NGINX redirects traffic to internal server on LAN interface
Similar setup for FQDN 2 >>> Server 2   etc.
I just need to see example how to configure Nginx for above example

Thanks,


Title: Re: Nginx revers proxy
Post by: fabian on March 12, 2020, 06:27:21 AM
HTTP:

https://docs.opnsense.org/manual/how-tos/nginx.html

HTTPS:

Ifbyou want to terminate TLS, it is the same as HTTP. If you do not want that, you can use streams with an upstream map.