From 4d72fa42e315614f8a453d51667ca54130ba8de9 Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Tue, 15 Aug 2017 17:00:03 -0700 Subject: [PATCH 1/3] expand nginx no name error --- certbot-nginx/certbot_nginx/configurator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py index fbe881bb0..80df1c4f5 100644 --- a/certbot-nginx/certbot_nginx/configurator.py +++ b/certbot-nginx/certbot_nginx/configurator.py @@ -236,7 +236,10 @@ class NginxConfigurator(common.Plugin): if not vhost: # No matches. Raise a misconfiguration error. raise errors.MisconfigurationError( - "Cannot find a VirtualHost matching domain %s." % (target_name)) + """Cannot find a VirtualHost matching domain %s. + In order for Certbot to correctly perform the challenge + please add a server_name directive to your nginx configuration. + This configuration file can likely be found in /etc/nginx""" % (target_name)) else: # Note: if we are enhancing with ocsp, vhost should already be ssl. if not vhost.ssl: From 2c9e072a9f178082ff15d8cd1612a0b67f46dd86 Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Tue, 15 Aug 2017 17:39:23 -0700 Subject: [PATCH 2/3] link to nginx documentation --- certbot-nginx/certbot_nginx/configurator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py index 80df1c4f5..d77c5c2bc 100644 --- a/certbot-nginx/certbot_nginx/configurator.py +++ b/certbot-nginx/certbot_nginx/configurator.py @@ -238,8 +238,9 @@ class NginxConfigurator(common.Plugin): raise errors.MisconfigurationError( """Cannot find a VirtualHost matching domain %s. In order for Certbot to correctly perform the challenge - please add a server_name directive to your nginx configuration. - This configuration file can likely be found in /etc/nginx""" % (target_name)) + please add a corresponding server_name directive to your + nginx configuration: + https://nginx.org/en/docs/http/server_names.html""" % (target_name)) else: # Note: if we are enhancing with ocsp, vhost should already be ssl. if not vhost.ssl: From df71ec33b33c68461a992ac4dee9812c5748cd42 Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Mon, 28 Aug 2017 13:45:42 -0500 Subject: [PATCH 3/3] switch from triple quotes to single quotes --- certbot-nginx/certbot_nginx/configurator.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py index d77c5c2bc..0579c8d52 100644 --- a/certbot-nginx/certbot_nginx/configurator.py +++ b/certbot-nginx/certbot_nginx/configurator.py @@ -236,11 +236,11 @@ class NginxConfigurator(common.Plugin): if not vhost: # 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)) + ("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)) else: # Note: if we are enhancing with ocsp, vhost should already be ssl. if not vhost.ssl: