http:
middlewares:
redirect-to-https:
redirectscheme:
scheme: https
gzip:
compress: true
routers:
lb-http:
middlewares:
- redirect-to-https
entryPoints:
- http
service: noop
# Change <CHANGE_THIS_TO_YOUR_DOMAIN> to your domain, like `example.com` without `https://`
rule: Host(`<CHANGE_THIS_TO_YOUR_DOMAIN>`)
lb-https:
middlewares:
- gzip
entryPoints:
- https
service: lb-https
tls:
certResolver: letsencrypt
# Change <CHANGE_THIS_TO_YOUR_DOMAIN> to your domain, like `example.com` without `https://`
rule: Host(`<CHANGE_THIS_TO_YOUR_DOMAIN>`)
services:
lb-https:
loadBalancer:
servers:
# Change <CHANGE_THIS_TO_YOUR_IP_ADDRESS> to your servers IP addresses
- url: 'http://<CHANGE_THIS_TO_YOUR_IP_ADDRESS>'
- url: 'http://<CHANGE_THIS_TO_YOUR_IP_ADDRESS>'
# Add any number of servers you want to loadbalance between
noop:
loadBalancer:
servers:
- url: ''