lab-ansible/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2

48 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-12-29 18:07:08 +00:00
{# code: language=ansible-jinja #}
# THIS FILE IS MANAGED BY ANSIBLE
2023-11-08 21:30:41 +00:00
server {
listen 8080;
2023-11-11 14:47:51 +00:00
server_name {{ apps_vars.nextcloud.domain }};
2023-11-08 21:30:41 +00:00
location / {
2023-12-25 20:49:17 +00:00
set $upstream http://nextcloud:80;
proxy_pass $upstream;
2023-12-31 13:48:22 +00:00
2023-11-08 21:30:41 +00:00
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2023-11-11 14:47:51 +00:00
proxy_set_header X-Forwarded-Proto "https";
proxy_set_header X-Real-IP $remote_addr;
2024-01-28 18:24:00 +00:00
proxy_set_header Host $host;
2024-01-01 15:33:52 +00:00
# WebSocket support
proxy_http_version 1.1;
2023-12-31 13:48:22 +00:00
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
2024-01-01 15:33:52 +00:00
# Options required by Nextcloud
2023-12-31 13:48:22 +00:00
client_body_buffer_size 512k;
client_max_body_size 0;
2024-02-09 17:19:02 +00:00
# UnifiedPush
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
}
# UnifiedPush Matrix gateway
location /_matrix/push/v1/notify {
set $upstream http://nextcloud:80;
proxy_pass $upstream/index.php/apps/uppush/gateway/matrix;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "https";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
2023-11-08 21:30:41 +00:00
}
2024-02-09 17:19:02 +00:00
# CalDAV & CardDAV
2023-11-11 14:47:51 +00:00
location ~^/\.well-known/(cal|card)dav$ {
return 301 https://$host/remote.php/dav;
2023-11-08 21:30:41 +00:00
}
}