OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: marcelmah on June 02, 2020, 10:41:53 AM

Title: NGINX URL rewrite with Lets Encrypt
Post by: marcelmah on June 02, 2020, 10:41:53 AM
Hi,

I'm using OPNsense with the NGINX plugin to host a website (just some files) and redirect another domein to a Facebook page.

Both 'sites' have HTTPS working via Lets Encrypt.
One works fine, the URL redirect version does not renew. I created a certificate once when It was a normal site with a meta redirect in a HTML file, I changed it to a URL rewrite but now It also rewrites the challenge for Lets Encrypt.

My current rewrite rule is: ^/(.*)$

Any suggestions in how I can fix this?
Title: Re: NGINX URL rewrite with Lets Encrypt
Post by: fabian on June 02, 2020, 08:48:07 PM
This matches every URL. It must not match ".well-known". So just exclude everything that starts with a dot.
Title: Re: NGINX URL rewrite with Lets Encrypt
Post by: marcelmah on June 03, 2020, 05:03:04 PM
Hi,

Sorry for the late reply.

This was my thought also, but I have no experience with regex.
I Googled before I posted for a solution, but the code I found breaks the NGINX service in OPNsense when I paste it in the input field.

Could you or anyone tell me what I should enter exactly to allow .well-known to pass trough and not be redirected?

PS. I should have posted this in my first post...