mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Add (nonexistent) document root so we don't use the default value
This commit is contained in:
parent
7e463bccad
commit
1a5ff134f4
1 changed files with 5 additions and 0 deletions
|
|
@ -155,10 +155,15 @@ class NginxHttp01(common.ChallengePerformer):
|
|||
addrs = self._default_listen_addresses()
|
||||
block = [['listen', ' ', addr.to_string(include_default=False)] for addr in addrs]
|
||||
|
||||
# Ensure we 404 on any other request by setting a root
|
||||
document_root = os.path.join(
|
||||
self.configurator.config.work_dir, "http_01_nonexistent")
|
||||
|
||||
validation = achall.validation(achall.account_key)
|
||||
validation_path = self._get_validation_path(achall)
|
||||
|
||||
block.extend([['server_name', ' ', achall.domain],
|
||||
['root', ' ', document_root],
|
||||
[['location', ' ', '=', ' ', validation_path],
|
||||
[['default_type', ' ', 'text/plain'],
|
||||
['return', ' ', '200', ' ', validation]]]])
|
||||
|
|
|
|||
Loading…
Reference in a new issue