From ef764de3ae8aec1f3c8548b5430c7e021008fa03 Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Sat, 19 Aug 2023 17:18:53 +0200 Subject: [PATCH] Return 404 for root path --- .../etc/nginx/sites-available/spring_domain_existing.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ansible/roles/spring_boot/templates/etc/nginx/sites-available/spring_domain_existing.conf.j2 b/ansible/roles/spring_boot/templates/etc/nginx/sites-available/spring_domain_existing.conf.j2 index 45a7b98..5343c11 100644 --- a/ansible/roles/spring_boot/templates/etc/nginx/sites-available/spring_domain_existing.conf.j2 +++ b/ansible/roles/spring_boot/templates/etc/nginx/sites-available/spring_domain_existing.conf.j2 @@ -16,6 +16,10 @@ server { {% endif %} {% endfor %} + location = / { + return 404; + } + listen [::]:443 ssl ipv6only=on; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/{{ spring_domain }}/fullchain.pem; # managed by Certbot