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 ~ ^/(?.+)$ { # 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; } }