Merge branch 'http01-nginx' of github.com:certbot/certbot into test-http01-nginx2

This commit is contained in:
Brad Warren 2018-01-11 14:45:45 -08:00
commit cfe5854aa3

View file

@ -392,17 +392,8 @@ class NginxConfigurator(common.Installer):
"""
matches = self._get_redirect_ranked_matches(target_name, port)
vhost = self._select_best_name_match(matches)
if not vhost:
if create_if_no_match:
vhost = self._vhost_from_duplicated_default(target_name)
else:
# No matches. Raise a misconfiguration error.
raise errors.MisconfigurationError(
("Cannot find a VirtualHost matching domain %s. "
"In order for Certbot to correctly perform the challenge "
"please add a corresponding server_name directive to your "
"nginx configuration: "
"https://nginx.org/en/docs/http/server_names.html") % (target_name))
if not vhost and create_if_no_match:
vhost = self._vhost_from_duplicated_default(target_name)
return vhost
def _get_redirect_ranked_matches(self, target_name, port):