summarylogtreecommitdiffstats
path: root/kimai2-nginx.conf
blob: 06656def82cf09210abd712efaa9cf7b9869b432 (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
41
42
43
44
45
46
47
48
49
50
server {
	listen 88.198.5.112:443 ssl;
	server_name kimai2.dom;
	ssl_certificate /etc/letsencrypt/live/dom/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/dom/privkey.pem;
	ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_session_cache shared:SSL:10m;
	ssl_prefer_server_ciphers on;
	server_tokens off;
	client_max_body_size 0;
	root /usr/share/webapps/kimai2/public;
	index index.php;

	access_log /var/log/nginx/kimai2.access.log;
	error_log /var/log/nginx/kimai2.error.log;

	location ~ /\.ht {
		deny all;
	}

	location / {
		try_files $uri /index.php$is_args$args;
	}

	location ~ ^/index\.php(/|$) {
		fastcgi_pass unix:/run/php-fpm/php-fpm-kimai2.sock;
		fastcgi_split_path_info ^(.+\.php)(/.*)$;
		include fastcgi_params;
		# You can use the document root directly:
		# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

		# But this is not working in every situation. When you are using symlinks to link the document
		# root to the current version of your application, you should pass the real
		# application path instead of the path to the symlink to PHP FPM.
		# Otherwise, PHP's OPcache may not properly detect changes to your PHP files
		# (see https://github.com/zendtech/ZendOptimizerPlus/issues/126 for more information).
		fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
		fastcgi_param DOCUMENT_ROOT $realpath_root;

		fastcgi_param PHP_VALUE memory_limit=512M;
        fastcgi_param PHP_VALUE open_basedir="/usr/share/webapps/kimai2:/etc/webapps/kimai2:/tmp:/var/lib/kimai2";

		internal;
	}

	location ~ \.php$ {
		return 404;
	}
}