1. add nginx 404 block for spammers and bots based on their user agent. 2. add HTTP basic auth (NGINX and Apache) to protect your site or selfhosted apps from those same spammers, bots and freeloaders (build)

This commit is contained in:
kurets 2024-09-05 17:24:19 +03:00
parent efb361a51e
commit f16bea329c
Signed by: kurets
GPG key ID: EEB449C295BF5174
3 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ Adapt the following for your use case and simply place it in every nginx.conf th
</div>
<small><em><p style="color: var(--muted_text);">作成日: <time datetime="2024-09-05T16:58:04&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time>, 最終更新日: <time datetime="2024-09-05T16:58:04&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time> </p></em></small>
<small><em><p style="color: var(--muted_text);">作成日: <time datetime="2024-09-05T16:58:04&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time>, 最終更新日: <time datetime="2024-09-05T17:22:43&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time> </p></em></small>
<div class="post-content"><p>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.</p>
<p>Adapt the following for your use case and simply place it in every nginx.conf that is <code>ln -s</code> linked to your <code>/etc/nginx/sites-enabled</code> (<em>it should be under the <code>listen 443</code> server block if you use certbot. Don&rsquo;t add it under <code>location</code> it should be on the same level as <code>listen [::]:443 ssl;</code></em>)</p>

View file

@ -24,7 +24,7 @@ Create a username and password for authentication (or more than 1 user) First:"/
</div>
<small><em><p style="color: var(--muted_text);">作成日: <time datetime="2024-09-05T17:05:07&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time>, 最終更新日: <time datetime="2024-09-05T17:05:07&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time> </p></em></small>
<small><em><p style="color: var(--muted_text);">作成日: <time datetime="2024-09-05T17:05:07&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time>, 最終更新日: <time datetime="2024-09-05T17:22:43&#43;03:00" style="color: var(--muted_text);">2024年9月5日 (木)</time> </p></em></small>
<div class="post-content"><p>Here&rsquo;s how to only allow authenticated users to view your websites - great way to boot freeloaders and guarantee your system&rsquo;s (<em>or your vps&rsquo;</em>) resources for yourself.</p>
<p>The guide is meant for debian but can be easily adapted to suit your needs. I assume you have followed Luke Smith&rsquo;s tutorial and have NGINX running with certbot for certificates.</p>
<h2 id="create-a-username-and-password-for-authentication-or-more-than-1-user">Create a username and password for authentication (<em>or more than 1 user</em>)<a hidden class="anchor" aria-hidden="true" href="#create-a-username-and-password-for-authentication-or-more-than-1-user">#</a></h2>

View file

@ -3,10 +3,10 @@
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://vodoraslo.xyz/articles/blog/restrict-unwanted-access-with-http-basic-auth-nginx-and-apache/</loc>
<lastmod>2024-09-05T17:05:07+03:00</lastmod>
<lastmod>2024-09-05T17:22:43+03:00</lastmod>
</url><url>
<loc>https://vodoraslo.xyz/articles/blog/block-and-filter-spam-requests-with-user-agents-in-nginx/</loc>
<lastmod>2024-09-05T16:58:04+03:00</lastmod>
<lastmod>2024-09-05T17:22:43+03:00</lastmod>
</url><url>
<loc>https://vodoraslo.xyz/articles/blog/neater-footnotes-in-hugo-using-the-details-html-tag/</loc>
<lastmod>2024-08-31T17:06:20+03:00</lastmod>