client_max_body_size 2000M; rewrite ^/owncloud$ /owncloud/ permanent; location /owncloud/ { alias /home/files/Apps/owncloud/; index index.php; try_files $uri $uri/ @owncloudwebdav; } location @owncloudwebdav { root /home/files/Apps; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_pass phpfiles; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ ^/owncloud/(.*\.php)$ { root /home/files/Apps; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass phpfiles; include fastcgi_params; } location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) { deny all; }