mirror of
https://github.com/certbot/certbot.git
synced 2026-04-20 21:58:54 -04:00
Add RewriteEngine on directive also in post (#10232)
Fixes https://github.com/certbot/certbot/issues/9835#issuecomment-2717096178, where our `RewriteEngine on` directive inserted at the beginning of a virtualhost was overridden a `RewriteEngine Off` directive later. This PR does the easy thing of placing `RewriteEngine on` in our post-insert.
This commit is contained in:
parent
8a6138856f
commit
aa005f20fe
3 changed files with 5 additions and 3 deletions
|
|
@ -24,10 +24,10 @@ class ApacheHttp01(common.ChallengePerformer):
|
|||
"""Class that performs HTTP-01 challenges within the Apache configurator."""
|
||||
|
||||
CONFIG_TEMPLATE24_PRE = """\
|
||||
RewriteEngine on
|
||||
RewriteRule ^/\\.well-known/acme-challenge/([A-Za-z0-9-_=]+)$ {0}/$1 [END]
|
||||
"""
|
||||
CONFIG_TEMPLATE24_POST = """\
|
||||
RewriteEngine on
|
||||
<Directory {0}>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class ApacheHttp01Test(util.ApacheTest):
|
|||
with open(self.http.challenge_conf_post) as f:
|
||||
post_conf_contents = f.read()
|
||||
|
||||
assert "RewriteEngine on" in pre_conf_contents
|
||||
assert "RewriteEngine on" in post_conf_contents
|
||||
assert "RewriteRule" in pre_conf_contents
|
||||
|
||||
assert self.http.challenge_dir in post_conf_contents
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
|
|||
|
||||
### Fixed
|
||||
|
||||
*
|
||||
* Moved `RewriteEngine on` directive added during apache http01 authentication
|
||||
to the end of the virtual host, so that it overwrites any `RewriteEngine off`
|
||||
directives that already exist and allows redirection to the challenge URL.
|
||||
|
||||
More details about these changes can be found on our GitHub repo.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue