diff --git a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml index ea57f4a5..85d9572b 100644 --- a/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml +++ b/{{cookiecutter.project_slug}}/compose/production/traefik/traefik.yml @@ -60,7 +60,11 @@ http: {%- if cookiecutter.cloud_provider == 'None' %} web-media-router: + {%- if cookiecutter.domain_name.count('.') == 1 %} + rule: "(Host(`{{ cookiecutter.domain_name }}`) || Host(`www.{{ cookiecutter.domain_name }}`)) && PathPrefix(`/media/`)" + {%- else %} rule: "Host(`{{ cookiecutter.domain_name }}`) && PathPrefix(`/media/`)" + {%- endif %} entryPoints: - web-secure middlewares: