I use the version 1.7 of traefik.
I use how reverse proxy for my applications in environment docker swarm.
I want to be able to configure Security Headers once for all frontend and not in each fontend configuration.
In my docker-compose I have 10 frontends. I have to add in labels section of each services configuration these properties
It’s a lot to set and to maintain.
How to configure my docker-compose of traefik for all applications?
docker-compose traefik
version: "3.4"
services:
traefik:
image: traefik:1.7
command:
- "--api"
- "--entrypoints=Name:internal_http Address::80"
- "--entrypoints=Name:internal_https Address::443
volumes:
labels:
- "dockerwall.outbound=x.x.x.x"
- "traefik.frontend.headers.frameDeny=true"
- "traefik.frontend.headers.SSLRedirect=true"
- "traefik.frontend.headers.STSPreload=true"
- "traefik.frontend.headers.STSSeconds=31536000"
- "traefik.frontend.headers.customResponseHeaders=Strict-Transport-Security:15552000"
ports:
deploy:
labels:
- traefik.frontend.headers.frameDeny=true
- traefik.frontend.headers.SSLRedirect=true
- traefik.frontend.headers.STSPreload=true
- traefik.frontend.headers.STSSeconds=31536000
- traefik.frontend.headers.customResponseHeaders=Strict-Transport-Security:15552000
dashboard:
image: x/http-proxy
deploy:
labels:
- traefik.frontend.entryPoints=internal_http,internal_https
- traefik.frontend.rule=x.x.x.x
- traefik.port=80
networks:
default:
external:
name: xxxxxxxx