Skip to content

Instantly share code, notes, and snippets.

@Voronenko
Created April 6, 2024 14:28
Show Gist options
  • Save Voronenko/edc0d6eabfd0b20863429b040e55130f to your computer and use it in GitHub Desktop.
Save Voronenko/edc0d6eabfd0b20863429b040e55130f to your computer and use it in GitHub Desktop.
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
http:
routers:
myrouter:
rule: "Host(`bchain.example.in`)"
middlewares:
- auth
service: "goserver"
entryPoints:
- websecure
tls:
options: "myoptions"
#certResolver: "myresolver"
#domains:
# - main: "bchain.example.in"
api:
rule: "Host(`traefik.example.in`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
entryPoints:
- websecure
middlewares:
- auth
service: "api@internal"
tls:
certResolver: "myresolver"
domains:
- main: "traefik.example.in"
api_http:
entryPoints:
- web
rule: "Host(`traefik.example.in`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
middlewares:
- auth
- redirect-to-https
service: "api@internal"
middlewares:
auth:
basicAuth:
users:
- "test:XXXX"
redirect-to-https:
redirectScheme:
scheme: "https"
port: "443"
permanent: true
services:
goserver:
loadBalancer:
servers:
- url: "http://INSTANCE_PRIVATE-IP:8001"
tls:
certificates:
- certFile: "/run/secrets/server.crt"
keyFile: "/run/secrets/server.key"
stores:
default:
defaultCertificate:
certFile: "/run/secrets/server.crt"
keyFile: "/run/secrets/server.key"
options:
myoptions:
minVersion: "VersionTLS12"
sniStrict: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment