ncrypt icon indicating copy to clipboard operation
ncrypt copied to clipboard

nginx with alias example

Open stbuehler opened this issue 9 years ago • 0 comments

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;
	}
}

stbuehler avatar Nov 29 '16 12:11 stbuehler