Skip to content

add http to https middleware redirect with priority instead of an entrypoint - #2287

Merged
domgz merged 7 commits into
usegalaxy-eu:masterfrom
gsaudade99:http/stratum0
Sep 2, 2026
Merged

add http to https middleware redirect with priority instead of an entrypoint#2287
domgz merged 7 commits into
usegalaxy-eu:masterfrom
gsaudade99:http/stratum0

Conversation

@gsaudade99

Copy link
Copy Markdown
Contributor

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.

Comment on lines +8 to +16
routers:
http-catchall:
rule: "HostRegexp(`^.+`)"
entryPoints:
- web
middlewares:
- https-redirect
priority: 1
service: noop@internal

@mira-miracoli mira-miracoli Aug 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
@mira-miracoli
mira-miracoli requested a review from domgz September 2, 2026 08:58
Comment thread files/traefik/rules/cvmfs-stratum0-router.yml Outdated
As Traefik is configured now, there is no "competition" for the `cvmfs-stratum0-rtr` router.
@domgz
domgz merged commit 3b143aa into usegalaxy-eu:master Sep 2, 2026
5 checks passed
Comment on lines +1 to +7
http:
middlewares:
usegalaxy-eu-ratelimit:
rateLimit:
average: 10
period: 1s
burst: 50

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to drop this one before merging, but it's not in use so it should be ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants