I am playing with Traefik v2 because i want to understand it better before deploy it in production. My goal is to replace several nginx reverse proxy (that manage several servers located in different network areas) with a single instance of Traefik.
- Some middlewares (headers) are not interpreted.
In a dynamic config file i have created
http: middlewares: testfirefoxheaders: headers: browserXssFilter: true contentTypeNosniff: true frameDeny: true
i am testing this testfirefoxheaders middleware with traefik container itself (http router, no https) and the labels are the following
- traefik.http.routers.traefik-dash2-unsecure.rule=Host("traefik.my.domain") - traefik.http.routers.traefik-dash2-unsecure.entrypoints=web - traefik.http.routers.traefik-dash2-unsecure.middlewares=testfirefoxheaders@file - traefik.http.routers.traefik-dash2-unsecure.service=api@internal
When i use firefox development tools and analyse the headers, i cannot see any of
X-Frame-Options..... in the response headers
Is there something i missed?
- Some Middleware important informations are not in the documentation
thanks to these forum, i have found some answers to some of my interrogations . I have read that
the middlewares order is the same as the definition order.sorry just found it in documentation
- we can not create multi-types middleware
Maybe i am wrong but i have not found theses informations in the documentation and in my opinion they are important.
The concept of middleware is really powerful, chains as well. My goal is to create a catalog of reusable piece of unit middlewares. Now i know that we cannot mix multi-types middleware but still dont know if in the same router we can define 2 middlewares of the same type? I think this information is also revelant and could be in the documentation.
For example, in the dynamic config i have created 2 middlewares for IP Whitelisting
http: middlewares: Station1IpWhitelist: ipWhiteList: sourceRange: - 172.20.x.x/32 Station2IpWhitelist: ipWhiteList: sourceRange: - 172.20.y.y/32
If in a router definition i use one of them, everything work normally. If i combine these 2 middlewares none of whitelist is working.
Note : as i said i don't know if it's normally possible to do so and if it should work but in the case it cannot work, i really think allowing to use several middleware of the same type in a router would make Traefik even more powerful.