From 7d0651c315846e1c48b707ab3e5eb8d059bf3f56 Mon Sep 17 00:00:00 2001 From: OsirisInferi Date: Sun, 2 Feb 2020 21:56:09 +0100 Subject: [PATCH] Parse `$hostname` in `server_name` --- certbot-nginx/certbot_nginx/_internal/configurator.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/certbot-nginx/certbot_nginx/_internal/configurator.py b/certbot-nginx/certbot_nginx/_internal/configurator.py index 70d9d87f8..4e5bfda4c 100644 --- a/certbot-nginx/certbot_nginx/_internal/configurator.py +++ b/certbot-nginx/certbot_nginx/_internal/configurator.py @@ -598,6 +598,13 @@ class NginxConfigurator(common.Installer): all_names = set() # type: Set[str] for vhost in self.parser.get_vhosts(): + try: + vhost.names.remove("$hostname") + vhost.names.add(socket.gethostname()) + breakpoint() + except KeyError: + pass + all_names.update(vhost.names) for addr in vhost.addrs: