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

50 lines
1.4 KiB
Django/Jinja

{# code: language=ansible-jinja #}
# THIS FILE IS MANAGED BY ANSIBLE
server {
server_name {{ apps_vars.nextcloud.domain }};
listen 8080;
set $upstream http://nextcloud:{{ apps_vars.nextcloud.port }};
proxy_http_version 1.1;
proxy_buffering off;
location / {
proxy_pass $upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "https";
# WebSocket support
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# Options required by Nextcloud
client_body_buffer_size 512k;
client_max_body_size 0;
# UnifiedPush
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
}
# UnifiedPush Matrix gateway
location /_matrix/push/v1/notify {
proxy_pass $upstream/index.php/apps/uppush/gateway/matrix;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto "https";
}
# CalDAV & CardDAV
location ~^/\.well-known/(cal|card)dav$ {
return 301 https://$host/remote.php/dav;
}
}