NGINX URL rewrite with Lets Encrypt

Started by marcelmah, June 02, 2020, 10:41:53 AM

Previous topic - Next topic
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?

This matches every URL. It must not match ".well-known". So just exclude everything that starts with a dot.

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...