Trying to use asDefault
to shorten my router list.
At the moment I have something akin to the following working:
entryPoints:
web:
address: ":80"
# Redirect all HTTP to HTTPS
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
http:
routers:
service1:
rule: "Host(`service1.example.com`)"
service: "service1"
entryPoints:
- "websecure"
service2:
rule: "Host(`service2.example.com`)"
service: "service2"
entryPoints:
- "websecure"
I would like to have something like:
entryPoints:
web:
address: ":80"
# Redirect all HTTP to HTTPS
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
asDefault: true
http:
routers:
service1:
rule: "Host(`service1.example.com`)"
service: "service1"
service2:
rule: "Host(`service2.example.com`)"
service: "service2"
It really is a moot point but when you have 20+ routers it significantly shortens the file.
Is this possible?
Thanks