diff --git a/certbot-nginx/certbot_nginx/configurator.py b/certbot-nginx/certbot_nginx/configurator.py index 0a8d2a88a..afa8b8087 100644 --- a/certbot-nginx/certbot_nginx/configurator.py +++ b/certbot-nginx/certbot_nginx/configurator.py @@ -338,11 +338,16 @@ class NginxConfigurator(common.Plugin): """ snakeoil_cert, snakeoil_key = self._get_snakeoil_paths() + options_subblock = self.parser.loc["ssl_options"] + # the options file doesn't have a newline at the beginning, but there + # needs to be one when it's dropped into the file + if "\n" not in options_subblock[0]: + options_subblock[0].insert(0, "\n") ssl_block = ( [['\n ', 'listen', ' ', '{0} ssl'.format(self.config.tls_sni_01_port)], ['\n ', 'ssl_certificate', ' ', snakeoil_cert], ['\n ', 'ssl_certificate_key', ' ', snakeoil_key]] + - self.parser.loc["ssl_options"]) + options_subblock) self.parser.add_server_directives( vhost.filep, vhost.names, ssl_block, replace=False)