[Fix] Stronger match for acme-challenge nginx location

If an application (for instance roundcube) installed at the root of a
subdomain has the following nginx configuration:

	location ~ ^/(.+/|)\. {
		deny all;
	}

acme-challenge matching location:

	location '/.well-known/acme-challenge'
	{
		default_type "text/plain";
		alias /tmp/acme-challenge-public/;
	}

will not be used.

This fix prevents further matching by regular expressions.

Co-authored-by: Tomo59 <thomas.gambier@gmail.com>
This commit is contained in:
Jean-Baptiste Lescher 2018-01-30 17:16:46 +01:00
parent e15ccdf0b7
commit 50bd20fce9

View file

@ -463,7 +463,7 @@ def _configure_for_acme_challenge(auth, domain):
nginx_conf_file = "%s/000-acmechallenge.conf" % nginx_conf_folder
nginx_configuration = '''
location '/.well-known/acme-challenge'
location ^~ '/.well-known/acme-challenge'
{
default_type "text/plain";
alias %s;