machines/magenta: use entrypoint configuration to https redirection

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-05 16:09:24 +03:00
parent b862cab4ef
commit 3e9c3701b1
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
2 changed files with 8 additions and 12 deletions

View file

@ -108,13 +108,7 @@ in
services.traefik.dynamicConfigOptions.http = {
routers = {
to_gitea_http = {
rule = "Host(`${hostname}`)";
entryPoints = [ "http" ];
middlewares = [ "https_redirect" ];
service = "noop@internal";
};
to_gitea_https = {
to_gitea = {
rule = "Host(`${hostname}`)";
entryPoints = [ "https" ];
tls.certResolver = "le";

View file

@ -18,7 +18,13 @@ in
enable = true;
staticConfigOptions = {
entryPoints = {
http.address = ":80";
http = {
address = ":80";
http.redirections.entryPoint = {
to = "https";
scheme = "https";
};
};
https.address = ":443";
dashboard.address = ":8080";
};
@ -40,10 +46,6 @@ in
service = "api@internal";
};
middlewares = {
https_redirect.redirectScheme = {
scheme = "https";
permanent = true;
};
traefik_dashboard_auth.basicAuth = {
usersFile = config.age.secrets.traefik-dashboard-basicauth-users.path;
};