[enh] fix up nginx conf

This commit is contained in:
Julien Malik 2015-01-25 21:16:44 +01:00
parent ccd2d7d08f
commit bc508761e9

View file

@ -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) {