add http to https middleware redirect with priority instead of an entrypoint - #2287
Conversation
| routers: | ||
| http-catchall: | ||
| rule: "HostRegexp(`^.+`)" | ||
| entryPoints: | ||
| - web | ||
| middlewares: | ||
| - https-redirect | ||
| priority: 1 | ||
| service: noop@internal |
There was a problem hiding this comment.
| routers: | |
| http-catchall: | |
| rule: "HostRegexp(`^.+`)" | |
| entryPoints: | |
| - web | |
| middlewares: | |
| - https-redirect | |
| priority: 1 | |
| service: noop@internal |
This router would catch all requests that are not catched otherwise, apply the https-middleware and route to noop@internal.
I think to achive a 'https upgrade' we need to reference this middleware in all existing routers instead.
The other option would be to use Multi-Layer Routing, in that case this router would be a general parent router, but it needs to be referenced by every other router.
For simplicity reasons, I would prefer mentioning the middleware. Child routers can not have tls options, so we would need to rethink how we set TLS options for every Domain/Subdomain. And the 'brain load' when creating a new router is equal for both options (add a middleware vs add a parentRef. And if we want more general middlewares, we could instead create a chain and reference it
This is necessary, because entrypoint level handling would break CVMFS, see usegalaxy-eu#2287 This way each router that needs http-to-https redirect, references this middleware and adds the port 80 (web) entrypoint.
Redirect HTTP requests to HTTPs before applying any other middleware.
As Traefik is configured now, there is no "competition" for the `cvmfs-stratum0-rtr` router.
| http: | ||
| middlewares: | ||
| usegalaxy-eu-ratelimit: | ||
| rateLimit: | ||
| average: 10 | ||
| period: 1s | ||
| burst: 50 |
There was a problem hiding this comment.
I forgot to drop this one before merging, but it's not in use so it should be ok.
Adds a middleware router to make the http to https upgrade the default behaviour for every dns. With priority we can define exception to this case.