-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextcloud.conf
50 lines (44 loc) · 1.69 KB
/
nextcloud.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
client_max_body_size 1000M; # set maximum upload size
fastcgi_buffers 64 4K;
fastcgi_read_timeout 3600s;
# deny direct access
location ~ ^/pilvi/(data|config|\.ht|db_structure\.xml|README) {
root {{data_mount}}/webapps/;
error_page 403 = /pilvi/core/templates/403.php;
error_page 404 = /pilvi/core/templates/404.php;
deny all;
}
# default try order
location /pilvi {
root {{data_mount}}/webapps/;
error_page 403 = /pilvi/core/templates/403.php;
error_page 404 = /pilvi/core/templates/404.php;
rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^/apps/calendar/caldav.php /remote.php/caldav/ last;
rewrite ^/apps/contacts/carddav.php /remote.php/carddav/ last;
rewrite ^/apps/([^/]*)/(.*\.(css|php))$ /index.php?app=$1&getfile=$2 last;
rewrite ^(/core/doc[^\/]+/)$ $1/index.html;
index index.php; # This one might be redundant, but it doesn't hurt to leave it here
try_files $uri $uri/ @webdav;
}
# owncloud WebDAV
location @webdav {
root {{data_mount}}/webapps/;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi.conf;
}
# enable php
location ~ ^(?<script_name>/pilvi/.+?\.php)(?<path_info>/.*)?$ {
root {{data_mount}}/webapps/;
try_files $script_name = 404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi.conf;
}