summaryrefslogtreecommitdiff
path: root/playbooks.d/webserver/share/sites.d/nl.tyil.p
blob: e627a0dbafd8974d62b368cda3dab3480917ac4b (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
server {
	listen 443 ssl; # managed by Certbot
	listen [::]:443 ssl; # managed by Certbot

	server_name p.tyil.nl;

	ssl_certificate /etc/letsencrypt/live/p.tyil.nl/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/p.tyil.nl/privkey.pem;

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

	root /var/www/nl.tyil.p;

	location = / {
		return 301 https://www.tyil.nl/services/fiche/;
	}

	location ~ ^/(?<slug>.+)$ {
		# Disassociate all filetypes and their Content-Type, and
		# default everything to text/plain.
		types { } default_type text/plain;

		alias "/var/www/nl.tyil.p/${slug}/index.txt";
	}
}

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

	server_name p.tyil.nl;

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

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