nginx doesn't allow combining rewrite and alias, so this is a little bit difficult. This is the best I came up with so far:
~~~~ nginx with alias ~~~~
# nginx doesn't allow combining rewrite and alias
# also set $__config['site']['url'] accordingly
location /paste/ {
alias /srv/ncrypt/;
index not-existing-file;
fastcgi_split_path_info ^(/paste)(/.+)$;
include fastcgi.conf; # default fastcgi params
# overwrite some params
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
if (!-f $request_filename) {
fastcgi_pass php-backend;
}
# there is no need to access any php file directly
location ~ \.php$ {
deny all;
}
}
nginx doesn't allow combining rewrite and alias, so this is a little bit difficult. This is the best I came up with so far:
~~~~ nginx with alias ~~~~ # nginx doesn't allow combining rewrite and alias # also set $__config['site']['url'] accordingly location /paste/ { alias /srv/ncrypt/; index not-existing-file; fastcgi_split_path_info ^(/paste)(/.+)$; include fastcgi.conf; # default fastcgi params # overwrite some params fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_param PATH_INFO $fastcgi_path_info; if (!-f $request_filename) { fastcgi_pass php-backend; } # there is no need to access any php file directly location ~ \.php$ { deny all; } }