summarylogtreecommitdiffstats
path: root/kanboard-nginx-subdir.conf
blob: a9dcd7c3888bfdc3a7303474bfa978648326da94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Example configuration for running kanboard in a subdirectory, called kanbooard, on an existing site

location /kanboard {
	alias /usr/share/webapps/kanboard;

	access_log /var/log/nginx/kanboard_access.log;
	error_log /var/log/nginx/kanboard_error.log;
	index index.php index.html;

	#try_files $uri $uri/ /index.php$is_args$args;

	# Deny access to the directory data
	location ~ ^/kanboard/data/ {
		deny all;
		return 404;
	}

	# Deny access to .htaccess
	location ~ /kanboard/\.ht {
		deny all;
		return 404;
	}
	
	location ~ /kanboard/(config|config.default|kanboard).php$
	{
		deny all;
		return 404;
	}
	
	location ~ /kanboard/(.+\.php)$ {
		include fastcgi_params;
		try_files $uri =404;
		fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
		fastcgi_split_path_info ^(.+\.php)(/.+)$;
		fastcgi_param SCRIPT_FILENAME /usr/share/webapps/$fastcgi_script_name;
		fastcgi_index index.php;
	}
}