Issue on redirects
Hello !
I'm new with dokploy and I tried to setup a redirect for my website in the dokploy UI system. I'm just trying to do a https://bleguen.fr to https://www.bleguen.fr but when I do this. I do have a Bad gateway.
I tried the redirects presets.
Anyone have and idea ?
Thanks a lot
4 Replies
nice portfolio man
Thanks a lot ๐
Hi Graekor, to redirect https://bleguen.fr/ to https://www.bleguen.fr/, you can add a middleware to your container's Traefik configuration file. Find your container's Traefik configuration file in
/dashboard/traefik > ๐ dynamic
, then find the file with the same name as your application container. Then add middleware, like the example below:
Then add the middleware that you just created above, to your application router config, just add it to entryPoints = websecure
only.
For more tips:
Tip 1: you can also add middleware configuration to the middleware.yml
file in /dashboard/traefik > ๐ dynamic
, then add to the routers as per the steps above.
Tip 2: In addition to adding to the configuration file, if you have a compose file for your application, you can also add it to your application's compose file, by adding the following label to the compose file:
Below for reference:
https://doc.traefik.io/traefik/routing/routers/#middlewaresThanks you for the answer, after trying everything you said, it is working, I set the domain to bleguen.fr and not www.bleguen.fr but when i do so with the redirect then I have 404 page not found
When I add a second domain 'www.bleguen.fr' it's working but I don't think that's a good practice