add cors
This commit is contained in:
parent
0cd5eacb33
commit
461211ad29
|
@ -1,3 +1,8 @@
|
||||||
[http.middlewares.httpsRedirect.redirectScheme]
|
[http.middlewares.httpsRedirect.redirectScheme]
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
permanent = true
|
permanent = true
|
||||||
|
[http.middlewares.corsAll.headers]
|
||||||
|
AccessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
|
||||||
|
AccessControlAllowOrigin = "*"
|
||||||
|
AccessControlMaxAge = 100
|
||||||
|
AddVaryHeader = true
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
[http.routers.{{r.name}}]
|
[http.routers.{{r.name}}]
|
||||||
rule = "{{ r.rule }}"
|
rule = "{{ r.rule }}"
|
||||||
{% if r.tls %}
|
{% if r.tls %}
|
||||||
entryPoints = ["websecure"]
|
entryPoints = ["websecure"{% if r.corsAll %}, "corsAll"{% endif %}]
|
||||||
{% else %}
|
{% else %}
|
||||||
entryPoints = ["web"]
|
entryPoints = ["web"{% if r.corsAll %}, "corsAll"{% endif %}]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
service = "{{r.name}}@file"
|
service = "{{r.name}}@file"
|
||||||
{% if r.tls %}
|
{% if r.tls %}
|
||||||
|
|
Loading…
Reference in New Issue