location PATHTOCHANGE { alias ALIASTOCHANGE; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } index index.php; location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm-NAMETOCHANGE.sock; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param REMOTE_USER $remote_user; # the http_auth plugin uses REMOTE_USER and not PHP_AUTH_USER include fastcgi_params; } } location ~* ^PATHTOCHANGE/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) { deny all; } location ~* PATHTOCHANGE/data/public/.*.(ser|htaccess)$ { deny all; }