File tree Expand file tree Collapse file tree
resources/modules/Caddy/ospanel_data/default/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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
You can’t perform that action at this time.
0 commit comments