2024-02-03 21:12:59 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Nextcloud Web
|
|
|
|
|
|
|
|
Requires=nextcloud-app.service
|
|
|
|
After=nextcloud-app.service
|
|
|
|
|
|
|
|
[Container]
|
|
|
|
ContainerName=nextcloud-web
|
|
|
|
Image=docker.io/library/nginx:{{ nextcloud_nginx_version }}
|
|
|
|
|
|
|
|
Network=traefik.network
|
|
|
|
Network=nextcloud.network
|
|
|
|
|
|
|
|
Volume=/var/nextcloud/web/nginx.conf:/etc/nginx/nginx.conf
|
|
|
|
Volume=/var/nextcloud/app:/var/www/html:z
|
|
|
|
|
2024-02-04 13:45:20 +00:00
|
|
|
|
|
|
|
Label="traefik.http.middlewares.nextcloud_redirectregex.redirectregex.permanent=true"
|
|
|
|
Label="traefik.http.middlewares.nextcloud_redirectregex.redirectregex.regex=https://(.*)/.well-known/(?:card|cal)dav"
|
|
|
|
Label="traefik.http.middlewares.nextcloud_redirectregex.redirectregex.replacement=https://$${1}/remote.php/dav"
|
|
|
|
|
2024-02-04 00:53:47 +00:00
|
|
|
{% for domain in nextcloud_domains -%}
|
2024-02-04 13:45:20 +00:00
|
|
|
Label="traefik.http.routers.nextcloud{{loop.index}}.middlewares=nextcloud_redirectregex"
|
2024-02-03 21:12:59 +00:00
|
|
|
Label="traefik.http.routers.nextcloud{{loop.index}}.tls.certresolver=resolver"
|
|
|
|
Label="traefik.http.routers.nextcloud{{loop.index}}.tls=true"
|
|
|
|
Label="traefik.http.routers.nextcloud{{loop.index}}.rule=Host(`{{ domain }}`)"
|
|
|
|
Label="traefik.http.routers.nextcloud{{loop.index}}.service=nextcloud{{loop.index}}"
|
|
|
|
Label="traefik.http.services.nextcloud{{loop.index}}.loadbalancer.server.port=80"
|
2024-02-04 00:40:43 +00:00
|
|
|
{% endfor %}
|
2024-02-03 21:12:59 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Restart=on-failure
|
|
|
|
# Restart Delay
|
|
|
|
RestartSec=30
|
|
|
|
# Allowed time for the service to start.
|
|
|
|
TimeoutStartSec=90
|
|
|
|
# Allowed time for the service to stop.
|
|
|
|
TimeoutStopSec=90
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=default.target
|