Regular Expressions 101

Community Patterns

Nginx rewrite rule to match all urls except .well-known (letsencrypt challenge validation)

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^\/(?!\.well-known\/).*
/
mg

Description

Will match typical urls such as:

/
/somepage
/some/nested/page

Will not match URLs starting with

/.well-known/

Intended to allow auto-renewals of certs for domains that just redirect.

Submitted by anonymous - 2 years ago