, ownCloud nginx, , nginx SCRIPT_NAME. ownCloud domain.tld/owncloud/index.php, , $_SERVER['SCRIPT_NAME'] /owncloud/index.php, nginx ( include fastcgi_params;) index.php. , : fastcgi_param SCRIPT_NAME /owncloud/$fastcgi_script_name; php-location-block nginx.
nginx. , ; , , . : nginx 1.2.1 php 5.4.4 64- Debian Wheezy.
location /owncloud/ {
alias /var/www/owncloud/;
location ~ ^/owncloud/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}
rewrite ^/owncloud/caldav(.*)$ /owncloud/remote.php/caldav$1 redirect;
rewrite ^/owncloud/carddav(.*)$ /owncloud/remote.php/carddav$1 redirect;
rewrite ^/owncloud/webdav(.*)$ /owncloud/remote.php/webdav$1 redirect;
rewrite ^/owncloud/.well-known/host-meta /owncloud/public.php?service=host-meta last;
rewrite ^/owncloud/.well-known/host-meta.json /owncloud/public.php?service=host-meta-json last;
rewrite ^/owncloud/.well-known/carddav /owncloud/remote.php/carddav/ redirect;
rewrite ^/owncloud/.well-known/caldav /owncloud/remote.php/caldav/ redirect;
rewrite ^/owncloud/apps/([^/]*)/(.*\.(css|php))$ /owncloud/index.php?app=$1&getfile=$2 last;
rewrite ^(/owncloud/core/doc/[^\/]+/)$ $1/index.html;
try_files $uri $uri/ index.php;
location ~ ^/owncloud/(.+?\.php)/? {
fastcgi_split_path_info ^/owncloud/(.+?\.php)(/?.*)$;
set $path_info $fastcgi_path_info;
try_files $fastcgi_script_name = 404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_NAME /owncloud/$fastcgi_script_name;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}