Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
Nginx Reverse Proxy URL Rewrite
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nginx Reverse Proxy URL Rewrite (Read 6639 times)
SkeelKat
Newbie
Posts: 30
Karma: 0
Nginx Reverse Proxy URL Rewrite
«
on:
February 03, 2020, 01:46:52 pm »
Hi Everyone,
I am struggling slightly getting URL re-writing to work on the NGINX Reverse Proxy Plug-in. Can anyone please help.
I have a Upstream Server
nextcloud_server = x.x.x.x port 80
I have a Upstream
nextcloud_upstream = nextcloud_server
I have a Location
nexcloud_location
URL Pattern = /
Match type = none
URL Rewriting = Nothing
Upstream = nextcloud_upstream
Force HTTPS = 1
I have a HTTP Server
Servername = cloud.xxxxxxxxx.xxx
Location = nextcloud_location
Certificates setup correctly
With this configuration everything is working as it should with https etc working. However I need to do URL rewriting
https://cloud.xxxxxxxxx.xxx/.well-known/caldav
should rewrite to
https://cloud.xxxxxxxxx.xxx/remote.php/dav
Can anyone explain step by step how this is achieved in the plugin?
I have tried several combinations of URL matching in location with rewrite url's but nothing seems to work.
my logic implies that I should duplicate the nextcloud_location to something like this
nexcloud_location_caldav
URL Pattern = /.well-known/caldav/
Match type = Case Insensitive Match ("~*")
URL Rewriting = {New URL Rewriting} <<<< I think this is my issue. I have no idea what to do in this section
Upstream = nextcloud_upstream
Force HTTPS = 1
Then simply add nextcloud_location_caldav to the HTTP Server...
Any help would be appreciated.
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx Reverse Proxy URL Rewrite
«
Reply #1 on:
February 03, 2020, 04:58:01 pm »
You should do that on the Webserver behind OPNsense and if that is nginx as well you will find that information in the nextcloud docs.
Logged
SkeelKat
Newbie
Posts: 30
Karma: 0
Re: Nginx Reverse Proxy URL Rewrite
«
Reply #2 on:
February 03, 2020, 05:27:39 pm »
Hi Fabian.
I get what you are saying. Should be easy enough to do on the upstream server.
I would however love to understand how this can be done on OPNsense, for further use cases.
Sent from my EML-L29 using Tapatalk
Logged
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Nginx Reverse Proxy URL Rewrite
«
Reply #3 on:
February 03, 2020, 05:48:23 pm »
via a rewrite rule you have to add to the http server.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
20.1 Legacy Series
»
Nginx Reverse Proxy URL Rewrite