From ef5dc8116a4a648b28cdf6f23a8d801134abe536 Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Thu, 26 May 2022 14:00:55 +0200 Subject: [PATCH] Refactor duplicate config and add robots.txt location --- docker/nginx/etc/nginx/conf.d/default.conf | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docker/nginx/etc/nginx/conf.d/default.conf b/docker/nginx/etc/nginx/conf.d/default.conf index 613b0c3..e10174a 100644 --- a/docker/nginx/etc/nginx/conf.d/default.conf +++ b/docker/nginx/etc/nginx/conf.d/default.conf @@ -2,14 +2,21 @@ server { listen 80 default_server; listen [::]:80 default_server; - location / { - root /var/www/html; - index index.html; - try_files $uri $uri.html $uri/ /index.html; - } + root /var/www/html; + index index.html; location = /favicon.ico { - root /var/www/html; + access_log off; + log_not_found off; + } + + location = /robots.txt { + access_log off; + log_not_found off; + } + + location / { + try_files $uri $uri.html $uri/ /index.html; } # redirect server error pages to a static page