mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-30 19:45:23 +02:00
feat: add middlewares to domains
This commit is contained in:
@@ -302,6 +302,11 @@ export const createDomainLabels = (
|
||||
middlewares.push(middlewareName);
|
||||
}
|
||||
|
||||
// Add custom middlewares
|
||||
if (domain.middlewares?.length) {
|
||||
middlewares.push(...domain.middlewares);
|
||||
}
|
||||
|
||||
// Apply middlewares to router if any exist
|
||||
if (middlewares.length > 0) {
|
||||
labels.push(
|
||||
|
||||
@@ -133,7 +133,7 @@ export const createRouterConfig = async (
|
||||
}
|
||||
|
||||
if (entryPoint === "web" && https) {
|
||||
routerConfig.middlewares = ["redirect-to-https"];
|
||||
routerConfig.middlewares?.unshift("redirect-to-https");
|
||||
}
|
||||
|
||||
if ((entryPoint === "websecure" && https) || !https) {
|
||||
@@ -160,6 +160,11 @@ export const createRouterConfig = async (
|
||||
}
|
||||
routerConfig.middlewares?.push(middlewareName);
|
||||
}
|
||||
|
||||
// custom middlewares from domain
|
||||
if (domain.middlewares && domain.middlewares.length > 0) {
|
||||
routerConfig.middlewares?.push(...domain.middlewares);
|
||||
}
|
||||
}
|
||||
|
||||
if (entryPoint === "websecure") {
|
||||
|
||||
Reference in New Issue
Block a user