Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
22.7 Legacy Series
»
Help with Nginx proxy rewrite rule
« previous
next »
Print
Pages: [
1
]
Author
Topic: Help with Nginx proxy rewrite rule (Read 1360 times)
lenovo
Newbie
Posts: 3
Karma: 0
Help with Nginx proxy rewrite rule
«
on:
August 05, 2022, 03:19:52 am »
I use OPNsense Nginx as a proxy for a webserver.
The webserver has a site in a folder (myfolder) in the html root: /var/www/html/myfolder
This all works as expected. When I use a browser it shows
https://mywebsite.com/myfolder
in the address bar.
Now I'm trying to only rewrite the url with Nginx so the browser will show
https://mywebsite.com
but NOT redirect.
This is the OPNsense-Nginx config I tried:
Original URL Pattern (Regex): ^.*$
New URL Pattern:
https://mywebsite.com
Flag: (tried all options)
In location this rule is selected.
The result works (address bar only shows
https://mywebsite.com
), but browser errors with too many redirects.
Newbie here with Nginx and Regex, so I expect I'm doing something stupid.
Can some kind soul enlighten me and show me the right Regex syntax / Nginx url rewrite config?
«
Last Edit: August 05, 2022, 04:31:58 pm by lenovo
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
22.7 Legacy Series
»
Help with Nginx proxy rewrite rule