Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
URL Rewrite with Nginx from domain A to B?
« previous
next »
Print
Pages: [
1
]
Author
Topic: URL Rewrite with Nginx from domain A to B? (Read 2898 times)
mvdheijkant
Newbie
Posts: 29
Karma: 1
URL Rewrite with Nginx from domain A to B?
«
on:
April 21, 2022, 08:01:55 pm »
I'm using Nginx with reversy proxy instead of NAT.
What will the "Original URL Pattern (Regex)" and "New URL Pattern" be if I want to access a website externally with url "
https://my.externaldomain.eu
" going to an internal server that can be accessed by "
https://externaldomain.localdomain.local
".
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: URL Rewrite with Nginx from domain A to B?
«
Reply #1 on:
April 22, 2022, 08:31:50 pm »
You don't need any. Just use the new hostname in the http server and the internal one in the upstream server.
Logged
mvdheijkant
Newbie
Posts: 29
Karma: 1
Re: URL Rewrite with Nginx from domain A to B?
«
Reply #2 on:
April 23, 2022, 06:38:00 pm »
Yes, it sounds very strait forward. But than I think there's some other problem. let me explain a little bit further.
"
https://my.externaldomain.eu
" has a let's encrypt certificate on opnsense and "
https://externaldomain.localdomain.local
" is running with a self signed certificate.
First thing I tried and which worked was to create an internal website accessible from the lan also with "
https://my.externaldomain.eu
". The internal certificate was a random selfsigned certificate. With the necessary configuration on Nginx I was able to access the website from an external source.
I copied the configuration and changed the upstream server with "
https://externaldomain.localdomain.local
".
And at that point i'm kind of lost what to change to make it work.
Logged
fabian
Moderator
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: URL Rewrite with Nginx from domain A to B?
«
Reply #3 on:
April 29, 2022, 06:01:13 pm »
Does it actually make sense to use TLS between the upstream server and nginx?
If no, go via HTTP. If yes, use a certificate, OPNsense is trusting or disable certificate validation (advanced option; easy but not recommend) in the upstream.
Logged
mvdheijkant
Newbie
Posts: 29
Karma: 1
Re: URL Rewrite with Nginx from domain A to B?
«
Reply #4 on:
April 30, 2022, 08:36:52 pm »
I saw the same kind of question on
https://forum.opnsense.org/index.php?topic=15343.0
.
but there was no answer given on scenario's:
https://sited.com
proxies in to
https://192.168.xxx.bbb:443
https://sitee.com
proxies in to
https://192.168.xxx.ccc:443
They where supposed to work the same, have the same configuration, as the previous examples. Are they?
I'm looking for those configurations.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Web Proxy Filtering and Caching
(Moderator:
fabian
) »
URL Rewrite with Nginx from domain A to B?