Add sslheader middleware to Traefik configuration

This commit is contained in:
2024-03-02 11:24:09 +08:00
parent 4b6ce4e921
commit 4ac2faf61b
+6
View File
@@ -52,6 +52,7 @@ http:
- web-secure
middlewares:
- csrf
- sslheader
service: forum_server
tls:
# https://docs.traefik.io/master/routing/routers/#certresolver
@@ -141,6 +142,11 @@ http:
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
headers:
hostsProxyHeaders: ["X-CSRFToken"]
sslheader:
# https://docs.traefik.io/master/middlewares/headers/
headers:
customrequestheaders:
X-Forwarded-Proto: "https"
no-www:
redirectRegex:
regex: "^https?://www\\.(.+)"