mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 08:03:10 +02:00
Add (nonexistent) document root so we don't use the default value (#5437)
This commit is contained in:
@@ -155,10 +155,15 @@ class NginxHttp01(common.ChallengePerformer):
|
|||||||
addrs = self._default_listen_addresses()
|
addrs = self._default_listen_addresses()
|
||||||
block = [['listen', ' ', addr.to_string(include_default=False)] for addr in addrs]
|
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 = achall.validation(achall.account_key)
|
||||||
validation_path = self._get_validation_path(achall)
|
validation_path = self._get_validation_path(achall)
|
||||||
|
|
||||||
block.extend([['server_name', ' ', achall.domain],
|
block.extend([['server_name', ' ', achall.domain],
|
||||||
|
['root', ' ', document_root],
|
||||||
[['location', ' ', '=', ' ', validation_path],
|
[['location', ' ', '=', ' ', validation_path],
|
||||||
[['default_type', ' ', 'text/plain'],
|
[['default_type', ' ', 'text/plain'],
|
||||||
['return', ' ', '200', ' ', validation]]]])
|
['return', ' ', '200', ' ', validation]]]])
|
||||||
|
|||||||
Reference in New Issue
Block a user