Last active
June 22, 2022 09:41
-
-
Save thomas15v/a6fb66a479a5f2cec538c826e40036ae to your computer and use it in GitHub Desktop.
traefik.io nginx example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
nginx: | |
image: nginx:alpine | |
restart: always | |
labels: | |
- "traefik.enable=true" | |
- 'traefik.frontend.rule=Host:www.website.com' | |
- "traefik.port=80" | |
volumes: | |
- ./website:/usr/share/nginx/html | |
proxy: | |
image: traefik | |
command: --web -c /etc/traefik/traefik.toml --LOGLEVEL=debug | |
restart: always | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- ./traefik.toml:/etc/traefik/traefik.toml | |
- /acme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InsecureSkipVerify = true | |
defaultEntryPoints = ["https", "http"] | |
[entryPoints] | |
[entryPoints.http] | |
address = ":80" | |
[entryPoints.http.redirect] | |
entryPoint = "https" | |
[entryPoints.https] | |
address = ":443" | |
compress = true | |
[entryPoints.https.tls] | |
[acme] | |
email = "[email protected]" | |
storage = "/acme/acme.json" | |
entryPoint = "https" | |
OnHostRule = true | |
[acme.httpChallenge] | |
entryPoint = "http" | |
[docker] | |
endpoint = "unix:///var/run/docker.sock" | |
domain = "docker.localhost" | |
exposedbydefault = false | |
watch = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this works on traefik:v1.7.21 not on the latest version of the container