diff --git a/conf/nginx.conf b/conf/nginx.conf index 9a3aea1..db746eb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,11 +1,30 @@ location PATHTOCHANGE { - alias ALIASTOCHANGE; + alias ALIASTOCHANGE/; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - + index index.php; - + + rewrite ^PATHTOCHANGE/dashboard|^PATHTOCHANGE/settings|^PATHTOCHANGE/welcome|^PATHTOCHANGE/ws- PATHTOCHANGE/index.php last; + + if ( !-e $request_filename ) { + # WebDAV Rewrites + rewrite ^PATHTOCHANGE/shares PATHTOCHANGE/dav.php last; + # Sync client + rewrite ^PATHTOCHANGE/api PATHTOCHANGE/rest.php last; + # External users + rewrite ^PATHTOCHANGE/user PATHTOCHANGE/index.php?get_action=user_access_point last; + # Public shares + rewrite ^PATHTOCHANGE/data/public/([a-zA-Z0-9_-]+)\.php$ PATHTOCHANGE/data/public/share.php?hash=$1?; + } + + rewrite ^PATHTOCHANGE/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ PATHTOCHANGE/data/public/share.php?hash=$1&lang=$2?; + rewrite ^PATHTOCHANGE/data/public/([a-zA-Z0-9_-]+)$ PATHTOCHANGE/data/public/share.php?hash=$1?; + + # Prevent Clickjacking + add_header X-Frame-Options "SAMEORIGIN"; + location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; include fastcgi_params; @@ -13,6 +32,14 @@ location PATHTOCHANGE { fastcgi_param REMOTE_USER $remote_user; fastcgi_param SCRIPT_FILENAME $request_filename; } + + + # Enables Caching + location ~* \.(ico|css|js)$ { + expires 7d; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } } location ~* ^PATHTOCHANGE/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) {