mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-27 12:04:03 +03:00
68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
|
log:
|
||
|
level: INFO
|
||
|
|
||
|
entryPoints:
|
||
|
web:
|
||
|
# http
|
||
|
address: ":80"
|
||
|
|
||
|
web-secure:
|
||
|
# https
|
||
|
address: ":443"
|
||
|
|
||
|
certificatesResolvers:
|
||
|
letsencrypt:
|
||
|
# https://docs.traefik.io/master/https/acme/#lets-encrypt
|
||
|
acme:
|
||
|
email: "{{ cookiecutter.email }}"
|
||
|
storage: /etc/traefik/acme/acme.json
|
||
|
# https://docs.traefik.io/master/https/acme/#httpchallenge
|
||
|
httpChallenge:
|
||
|
entryPoint: web
|
||
|
|
||
|
http:
|
||
|
routers:
|
||
|
web-router:
|
||
|
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||
|
entryPoints:
|
||
|
- web
|
||
|
middlewares:
|
||
|
- redirect
|
||
|
- csrf
|
||
|
service: django
|
||
|
|
||
|
web-secure-router:
|
||
|
rule: "Host(`{{ cookiecutter.domain_name }}`)"
|
||
|
entryPoints:
|
||
|
- web-secure
|
||
|
middlewares:
|
||
|
- csrf
|
||
|
service: django
|
||
|
tls:
|
||
|
# https://docs.traefik.io/master/routing/routers/#certresolver
|
||
|
certResolver: letsencrypt
|
||
|
|
||
|
middlewares:
|
||
|
redirect:
|
||
|
# https://docs.traefik.io/master/middlewares/redirectscheme/
|
||
|
redirectScheme:
|
||
|
scheme: https
|
||
|
permanent: true
|
||
|
csrf:
|
||
|
# https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
|
||
|
# https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
|
||
|
headers:
|
||
|
hostsProxyHeaders: ['X-CSRFToken']
|
||
|
|
||
|
services:
|
||
|
django:
|
||
|
loadBalancer:
|
||
|
servers:
|
||
|
- url: http://django:5000
|
||
|
|
||
|
providers:
|
||
|
# https://docs.traefik.io/master/providers/file/
|
||
|
file:
|
||
|
filename: /etc/traefik/traefik.yml
|
||
|
watch: true
|