mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: server traefik config
This commit is contained in:
@@ -104,8 +104,7 @@ export const createDefaultServerTraefikConfig = () => {
|
||||
[`${appName}-router-app`]: {
|
||||
rule: `Host(\`${appName}.docker.localhost\`) && PathPrefix(\`/\`)`,
|
||||
service: `${appName}-service-app`,
|
||||
entryPoints: ["web", "websecure"],
|
||||
tls: {},
|
||||
entryPoints: ["web"],
|
||||
},
|
||||
},
|
||||
services: {
|
||||
|
||||
@@ -19,14 +19,20 @@ export const updateServerTraefik = (
|
||||
|
||||
const currentRouterConfig = config.http.routers[`${appName}-router-app`];
|
||||
|
||||
if (currentRouterConfig) {
|
||||
if (newHost) {
|
||||
currentRouterConfig.rule = `Host(\`${newHost}\`)`;
|
||||
}
|
||||
if (currentRouterConfig && newHost) {
|
||||
currentRouterConfig.rule = `Host(\`${newHost}\`)`;
|
||||
|
||||
if (admin?.certificateType === "letsencrypt") {
|
||||
currentRouterConfig.tls = { certResolver: "letsencrypt" };
|
||||
} else if (admin?.certificateType === "none") {
|
||||
currentRouterConfig.tls = undefined;
|
||||
config.http.routers[`${appName}-router-app-secure`] = {
|
||||
...currentRouterConfig,
|
||||
entryPoints: ["web-secure"],
|
||||
tls:
|
||||
admin?.certificateType === "letsencrypt"
|
||||
? { certResolver: "letsencrypt" }
|
||||
: undefined,
|
||||
};
|
||||
|
||||
currentRouterConfig.middlewares = ["redirect-to-https"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user