summaryrefslogtreecommitdiff
path: root/playbooks.d/webserver/share/sites.d/church.scriptkitties
blob: 72278443ebdf6a92c13f7ee98ed41fbb3ac860ad (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
server {
	listen 443 ssl http2; # managed by Certbot
	listen [::]:443 ssl http2; # managed by Certbot

	server_name scriptkitties.church;

	ssl_certificate /etc/letsencrypt/live/scriptkitties.church/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/scriptkitties.church/privkey.pem;

	include /etc/nginx/conf.d/certbot.conf;
	#include /etc/nginx/conf.d/headers.conf;
	include /etc/nginx/conf.d/ssl.conf;
	include mime.types;

	root /var/www/church.scriptkitties;
	index index.php;

	autoindex off;
	fastcgi_param HTTPS on;
	client_max_body_size 10m;
	client_body_buffer_size 128k;

	location / {
		try_files $uri /index.php?pagename=$uri&$args;
	}

	location ^~ /.well-known/ {
		allow all;
		rewrite ^ /index.php?pagename=$uri;
	}

	location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|ttf|woff|svg)$ {
		expires 30d;
		try_files $uri /index.php?pagename=$uri&$args;
	}

	location ~* \.php$ {
		try_files $uri =404;

		fastcgi_split_path_info ^(.+\.php)(/.+)$;

		fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

		include fastcgi_params;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

		fastcgi_buffers 16 16k; 
		fastcgi_buffer_size 32k;
	}

	location ~* \.(tpl|md|tgz|log|out)$ {
		deny all;
	}

	location ~ /\. {
		deny all;
	}

	location ^~ /bin {
		deny all;
	}
}

server {
	listen 80;
	listen [::]:80;

	server_name scriptkitties.church;

	include /etc/nginx/conf.d/certbot.conf;
	include /etc/nginx/conf.d/headers.conf;

	location / {
		return 301 https://$host$request_uri;
	}
}