Set up load balancing and health checks for nextcloud
This commit is contained in:
parent
29f838b2f1
commit
d154afd699
2 changed files with 15 additions and 2 deletions
|
@ -201,7 +201,12 @@ backend authentik_ldap
|
||||||
|
|
||||||
backend nextcloud
|
backend nextcloud
|
||||||
mode http
|
mode http
|
||||||
server s1 nextcloud-1:80 check
|
option httpchk
|
||||||
|
http-check send meth GET uri /status.php hdr Host nc.comfycamp.space
|
||||||
|
http-check expect status 200
|
||||||
|
cookie SERVER insert indirect nocache
|
||||||
|
server s1 nextcloud-1:80 check inter 15s cookie s1
|
||||||
|
server s2 nextcloud-2:80 check inter 15s cookie s2
|
||||||
|
|
||||||
backend mta_sts
|
backend mta_sts
|
||||||
mode http
|
mode http
|
||||||
|
|
|
@ -34,7 +34,15 @@
|
||||||
- /mnt/hdd/nextcloud/data:/var/www/html/data
|
- /mnt/hdd/nextcloud/data:/var/www/html/data
|
||||||
recreate: "{{ cfg.changed }}"
|
recreate: "{{ cfg.changed }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
loop: [1]
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "--fail", "http://127.0.0.1/status.php"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
# TODO: enable after ansible update
|
||||||
|
# state: healthy
|
||||||
|
loop: [1, 2]
|
||||||
- name: Schedule background jobs
|
- name: Schedule background jobs
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.cron:
|
ansible.builtin.cron:
|
||||||
|
|
Loading…
Reference in a new issue