mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-12-24 12:14:23 +08:00
Switch suggested Apache configuration from <Directory> to <LocationMatch> to avoid the requirement for a "<DocumentRoot>/.well-known/acme-challenge" directory to exist on the file-system
@@ -41,19 +41,19 @@ Configure your webserver to respond statelessly to challenges for a given accoun
|
||||
```
|
||||
### APACHE
|
||||
|
||||
_Tested on Apache 2.4.61_
|
||||
_Tested on Apache 2.4.62_
|
||||
|
||||
Add something similar to your `httpd.conf`:
|
||||
```apache
|
||||
...
|
||||
<VirtualHost *:80>
|
||||
...
|
||||
<Directory "/PATH/TO/WWW/ROOT/.well-known/acme-challenge/">
|
||||
<LocationMatch "/.well-known/acme-challenge/(?<challenge>[-_a-zA-Z0-9]+)">
|
||||
RewriteEngine On
|
||||
RewriteRule "^([-_a-zA-Z0-9]+)$" "$1" [E=challenge:$1]
|
||||
ErrorDocument 200 "%{ENV:challenge}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
|
||||
ErrorDocument 200 "%{ENV:MATCH_CHALLENGE}.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd"
|
||||
RewriteRule ^ - [L,R=200]
|
||||
</Directory>
|
||||
</LocationMatch>
|
||||
...
|
||||
</VirtualHost>
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user