My server has been getting bussyblasted by spam requests from bots and other subhumans and I figured out a way to block them with NGINX.

Adapt the following for your use case and simply place it in every nginx.conf that is ln -s linked to your /etc/nginx/sites-enabled (it should be under the listen 443 server block if you use certbot. Don’t add it under location it should be on the same level as listen [::]:443 ssl;)

diff --git a/public/sitemap.xml b/public/sitemap.xml index 2ee17fef..953f6706 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -6,7 +6,7 @@ 2024-09-05T17:22:43+03:00 https://vodoraslo.xyz/articles/blog/block-and-filter-spam-requests-with-user-agents-in-nginx/ - 2024-09-05T17:22:43+03:00 + 2024-09-05T21:13:08+03:00 https://vodoraslo.xyz/articles/blog/neater-footnotes-in-hugo-using-the-details-html-tag/ 2024-08-31T17:06:20+03:00