Skip to content

Commit ae91310

Browse files
committed
Update caddy.conf
1 parent b498de4 commit ae91310

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

  • resources/modules/Caddy/ospanel_data/default/templates

resources/modules/Caddy/ospanel_data/default/templates/caddy.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,17 @@
300300
# Redirect www → apex
301301
(force_non_www) {
302302
@www_https {
303-
header_regexp Host ^www\.(.+)$
304-
header X-Forwarded-Proto https
303+
header_regexp Host (?i)^www\.(.+)$
304+
header_regexp X-Forwarded-Proto (?i)^https$
305305
}
306306
@www_https_direct {
307-
header_regexp Host ^www\.(.+)$
307+
header_regexp Host (?i)^www\.(.+)$
308308
protocol https
309309
not header X-Forwarded-Proto *
310310
}
311311
@www_http {
312-
header_regexp Host ^www\.(.+)$
313-
not header X-Forwarded-Proto https
312+
header_regexp Host (?i)^www\.(.+)$
313+
not header_regexp X-Forwarded-Proto (?i)^https$
314314
not protocol https
315315
}
316316
redir @www_https https://{re.Host.1}{uri} 301
@@ -321,7 +321,7 @@
321321
# Redirect HTTP → HTTPS
322322
(force_https) {
323323
@insecure {
324-
not header X-Forwarded-Proto https
324+
not header_regexp X-Forwarded-Proto (?i)^https$
325325
not protocol https
326326
}
327327
redir @insecure https://{host}{uri} 301

0 commit comments

Comments
 (0)