summarylogtreecommitdiffstats
path: root/kanboard-nginx-subdir.conf
blob: 1e1ed07a5659c3be7d1f66058f96a5a62600ccc7 (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 {
	root /usr/share/webapps;

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

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

	# 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 ~ /(.+\.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 $document_root$fastcgi_script_name;
		fastcgi_index index.php;
	}
}