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:
chrisandClaude Opus 5.5 committed 2026-11-22 13:56:13 +01:00
1 parent 0d6448b043
commit 6927c1c9aa
1 file changed
+1 -1
+1 -1
View File
@@ -3261,7 +3261,7 @@ if $_https_only ; then
cat <<EOF >> ${_new_vhost_config_file}
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
EOF
elif [ "$_type" = "FCGID" ]; then