#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { # Path to source alias __INSTALL_DIR__/; index index.php index.html; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file client_max_body_size 50M; # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) try_files $uri $uri/ __PATH__/__PATH__/index.php$is_args$args; location ~* \.php$ { fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } }