create_vhost.sh: don't redirect ACME challenges on https-only sites
The port 80 vhost of https-only sites redirected everything to https,
including /.well-known/acme-challenge/. Let's Encrypt (dehydrated,
http-01) then had to follow the redirect to port 443. Exclude the
challenge path from the redirect (as already done for redirect sites)
and drop the redundant 'RewriteCond %{HTTPS} !=on' on port 80.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0d6448b043
commit
6927c1c9aa
1 file changed
+1
-1
+1
-1
@@ -3261,7 +3261,7 @@ if $_https_only ; then
|
|||||||
cat <<EOF >> ${_new_vhost_config_file}
|
cat <<EOF >> ${_new_vhost_config_file}
|
||||||
|
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteCond %{HTTPS} !=on
|
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
|
||||||
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
|
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
|
||||||
EOF
|
EOF
|
||||||
elif [ "$_type" = "FCGID" ]; then
|
elif [ "$_type" = "FCGID" ]; then
|
||||||
|
|||||||
Reference in new issue
Block a user