diff --git a/Dockerfile b/Dockerfile index 7166d39..cda94ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,3 +3,4 @@ FROM nginx:1.24-bullseye COPY ./site-html /var/www/blog COPY ./site-repo/nginx.conf /etc/nginx/conf.d/default.conf COPY ./site-repo/counter /var/www/counter +COPY ./site-repo/robots.txt /var/www/robots.txt diff --git a/nginx.conf b/nginx.conf index 8e2cdc5..01da72d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -2,7 +2,9 @@ server { listen 80; server_name _; - return 418; + location /robots.txt { + alias /var/www/robots.txt; + } } server { @@ -21,6 +23,10 @@ server { add_header Cache-Control "public"; } + location /robots.txt { + alias /var/www/robots.txt; + } + error_page 404 /404.html; } @@ -33,6 +39,10 @@ server { location / { try_files $uri $uri/ /index.html; } + + location /robots.txt { + alias /var/www/robots.txt; + } } server { diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..a0ab15b --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: SemrushBot +Disallow: /