owncloud properly working, but not in sub dir anymore

This commit is contained in:
jkaberg 2014-08-11 20:17:38 +02:00
parent b5928de740
commit 44fcdc2066
3 changed files with 37 additions and 32 deletions

View File

@ -23,59 +23,64 @@ server {
include /etc/nginx/nginx-ssl.conf; include /etc/nginx/nginx-ssl.conf;
# Expose this directory as static files. # Expose this directory as static files.
root $ROOT; # TODO: This is bad, we shouldnt hack it like this.
root /usr/local/lib/owncloud;;
index index.html index.htm; index index.html index.htm;
# ownCloud configuration # ownCloud configuration
# TODO: we should support owncloud to be loaded from www root, but for now we dont :-)
client_max_body_size 10G; # set max upload size client_max_body_size 10G; # set max upload size
fastcgi_buffers 64 4K; 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;
index index.php;
error_page 403 /core/templates/403.php;
error_page 404 /core/templates/404.php;
location = /robots.txt { location = /robots.txt {
allow all; allow all;
log_not_found off; log_not_found off;
access_log off; access_log off;
} }
error_page 403 /owncloud/core/templates/403.php;
error_page 404 /owncloud/core/templates/404.php;
rewrite ^/caldav(.*)$ /owncloud/remote.php/caldav$1 redirect;
rewrite ^/carddav(.*)$ /owncloud/remote.php/carddav$1 redirect;
rewrite ^/webdav(.*)$ /owncloud/remote.php/webdav$1 redirect;
rewrite ^/owncloud$ /owncloud/ redirect;
rewrite ^/owncloud/$ /owncloud/index.php;
location /owncloud/ {
index index.php;
alias /usr/local/lib/owncloud/;
}
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 /usr/local/lib/owncloud/$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_NAME /owncloud/$fastcgi_script_name;
fastcgi_pass unix:/tmp/php-fastcgi.www-data.sock;
}
location ~ ^/(data|config|\.ht|db_structure\.xml|README) { location ~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all; deny all;
} }
location / {
# 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;
try_files $uri $uri/ index.php;
}
location ~ ^(.+?\.php)(/.*)?$ {
try_files $1 = 404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_param PATH_INFO $2;
fastcgi_param HTTPS on;
fastcgi_pass unix:/tmp/php-fastcgi.www-data.sock;
}
# Optional: set long EXPIRES header on static assets # Optional: set long EXPIRES header on static assets
location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { location ~* ^.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d; expires 30d;
# Optional: Don't log access to assets # Optional: Don't log access to assets
access_log off; access_log off;
} }
# Webfinger configuration. # Webfinger configuration.
# TODO: fix this for owncloud: http://doc.owncloud.org/server/5.0/admin_manual/installation/installation_others.html # TODO: fix this for owncloud
location = /.well-known/webfinger { location = /.well-known/webfinger {
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/local/bin/mailinabox-webfinger.php; fastcgi_param SCRIPT_FILENAME /usr/local/bin/mailinabox-webfinger.php;

View File

@ -52,7 +52,7 @@ define('CALDAV_SERVER', 'https://localhost');
define('CALDAV_PORT', '443'); define('CALDAV_PORT', '443');
// Path // Path
define('CALDAV_PATH', '/owncloud/remote.php/caldav/calendars/%u/'); define('CALDAV_PATH', '/remote.php/caldav/calendars/%u/');
// Personal CalDAV folder (calendar folder/principal) // Personal CalDAV folder (calendar folder/principal)
define('CALDAV_PERSONAL', ''); define('CALDAV_PERSONAL', '');

View File

@ -71,7 +71,7 @@ define('CARDDAV_PATH', '/remote.php/carddav/addressbooks/%u/');
// %u: replaced with the username // %u: replaced with the username
// %d: replaced with the domain // %d: replaced with the domain
// Add the trailing / // Add the trailing /
define('CARDDAV_DEFAULT_PATH', '/owncloud/remote.php/carddav/addressbooks/%u/contacts/'); define('CARDDAV_DEFAULT_PATH', '/remote.php/carddav/addressbooks/%u/contacts/');
// Server path to the GAL addressbook. This addressbook is readonly and searchable by the user, but it will NOT be synced. // Server path to the GAL addressbook. This addressbook is readonly and searchable by the user, but it will NOT be synced.
// If you don't want GAL, comment it // If you don't want GAL, comment it