WIP: Wrote a redirection to deuxfleurs.fr in Treafik config's comments #28

Closed
adrien wants to merge 1 commit from master into master
Owner

Redirecting all site traffic to deuxfleurs.fr (instead of serving deuxfleurs.org and the www equivalents) would be better foe SEO. Yeaaah, not a big deal, but still swell.

Check CPU usage if we apply this: will Traefik perform a regex per request? I know nginx tries to avoid that using variables like request_args and the like.

Redirecting all site traffic to deuxfleurs.fr (instead of serving deuxfleurs.org and the www equivalents) would be better foe SEO. Yeaaah, not a big deal, but still swell. Check CPU usage if we apply this: will Traefik perform a regex per request? I know nginx tries to avoid that using variables like `request_args` and the like.
adrien added 1 commit 2020-12-28 11:08:54 +00:00
Owner

Implemented in consul kv instead of consul kv as per the migration of the landing page to garage. I used your regex, it works and it is live now:

$ consul kv get -recurse /traefik/frontends/deuxfleurs.fr
traefik/frontends/deuxfleurs.fr/backend:back-garage
traefik/frontends/deuxfleurs.fr/priority:10
traefik/frontends/deuxfleurs.fr/redirect/permanent:true
traefik/frontends/deuxfleurs.fr/redirect/regex:^https?://(www.deuxfleurs.fr|deuxfleurs.org|www.deuxfleurs.org)/(.*)
traefik/frontends/deuxfleurs.fr/redirect/replacement:https://deuxfleurs.fr/$2
traefik/frontends/deuxfleurs.fr/routes/main/rule:Host:deuxfleurs.fr,deuxfleurs.org,www.deuxfleurs.fr,www.deuxfleurs.org;PathPrefix:/

example:

$ curl -v https://deuxfleurs.org
[quentin@lheureduthe app]$ curl -v https://deuxfleurs.org
> GET / HTTP/2
> Host: deuxfleurs.org
> user-agent: curl/7.69.1
> accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 301 
< location: https://deuxfleurs.fr/
< vary: Accept-Encoding
< content-type: text/plain; charset=utf-8
< content-length: 17
< date: Tue, 19 Jan 2021 12:54:18 GMT
< 
* Connection #0 to host deuxfleurs.org left intact
Implemented in consul kv instead of consul kv as per the migration of the landing page to garage. I used your regex, it works and it is live now: ``` $ consul kv get -recurse /traefik/frontends/deuxfleurs.fr traefik/frontends/deuxfleurs.fr/backend:back-garage traefik/frontends/deuxfleurs.fr/priority:10 traefik/frontends/deuxfleurs.fr/redirect/permanent:true traefik/frontends/deuxfleurs.fr/redirect/regex:^https?://(www.deuxfleurs.fr|deuxfleurs.org|www.deuxfleurs.org)/(.*) traefik/frontends/deuxfleurs.fr/redirect/replacement:https://deuxfleurs.fr/$2 traefik/frontends/deuxfleurs.fr/routes/main/rule:Host:deuxfleurs.fr,deuxfleurs.org,www.deuxfleurs.fr,www.deuxfleurs.org;PathPrefix:/ ``` example: ``` $ curl -v https://deuxfleurs.org [quentin@lheureduthe app]$ curl -v https://deuxfleurs.org > GET / HTTP/2 > Host: deuxfleurs.org > user-agent: curl/7.69.1 > accept: */* > * Connection state changed (MAX_CONCURRENT_STREAMS == 250)! < HTTP/2 301 < location: https://deuxfleurs.fr/ < vary: Accept-Encoding < content-type: text/plain; charset=utf-8 < content-length: 17 < date: Tue, 19 Jan 2021 12:54:18 GMT < * Connection #0 to host deuxfleurs.org left intact ```
quentin closed this pull request 2021-01-19 12:51:00 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/infrastructure#28
No description provided.