diff --git a/templates/conf.d/00-default.toml b/templates/conf.d/00-default.toml index 42955f4..d96ef13 100644 --- a/templates/conf.d/00-default.toml +++ b/templates/conf.d/00-default.toml @@ -2,7 +2,7 @@ scheme = "https" permanent = true [http.middlewares.corsAll.headers] - AccessControlAllowMethods= ["GET", "OPTIONS", "PUT"] - AccessControlAllowOrigin = "*" - AccessControlMaxAge = 100 - AddVaryHeader = true + accessControlAllowMethods= ["GET", "OPTIONS", "PUT"] + accessControlAllowOrigin = "origin-list-or-null" + accessControlMaxAge = 100 + addVaryHeader = true diff --git a/templates/conf.d/70-easy-proxy.toml b/templates/conf.d/70-easy-proxy.toml index 63560db..13fab05 100644 --- a/templates/conf.d/70-easy-proxy.toml +++ b/templates/conf.d/70-easy-proxy.toml @@ -20,9 +20,12 @@ [http.routers.{{r.name}}] rule = "{{ r.rule }}" {% if r.tls %} - entryPoints = ["websecure"{% if "corsAll" in r and r.corsAll %}, "corsAll"{% endif %}] + entryPoints = ["websecure"] {% else %} - entryPoints = ["web"{% if "corsAll" in r and r.corsAll %}, "corsAll"{% endif %}] + entryPoints = ["web"] +{% endif %} +{% if "corsAll" in r and r.corsAll %} + middlewares = ["corsAll"] {% endif %} service = "{{r.name}}@file" {% if r.tls %}