Acho que funcionei. O redirecionamento parece funcionar também. Espero que tudo esteja correto. Aqui está minha localização / owncloud:
location /owncloud {
root /var/www/;
index index.php;
try_files $uri $uri/ index.php;
client_max_body_size 10G; # set max upload size
fastcgi_buffers 64 4K;
rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
# The following 2 rules are only needed with webfinger
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 ^(/core/doc/[^\/]+/)$ $1/index.html;
error_page 403 = /var/www/owncloud/core/templates/403.php;
error_page 404 = /var/www/owncloud/core/templates/404.php;
location ~ ^/robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
location ~ \.php$ {
include fastcgi-gen.conf;
}
location ~* \.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires max;
}
}
location /cloud {
rewrite ^/* /owncloud last;
}