<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://wiki.webko.net.ua/index.php?action=history&amp;feed=atom&amp;title=Nginx_Block_User_Agent</id>
	<title>Nginx Block User Agent - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.webko.net.ua/index.php?action=history&amp;feed=atom&amp;title=Nginx_Block_User_Agent"/>
	<link rel="alternate" type="text/html" href="https://wiki.webko.net.ua/index.php?title=Nginx_Block_User_Agent&amp;action=history"/>
	<updated>2026-05-11T11:44:14Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.webko.net.ua/index.php?title=Nginx_Block_User_Agent&amp;diff=203&amp;oldid=prev</id>
		<title>Sol в 16:07, 13 августа 2015</title>
		<link rel="alternate" type="text/html" href="https://wiki.webko.net.ua/index.php?title=Nginx_Block_User_Agent&amp;diff=203&amp;oldid=prev"/>
		<updated>2015-08-13T16:07:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия 16:07, 13 августа 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Строка 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Строка 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://forum.vestacp.com/viewtopic.php?f=28&amp;amp;t=8975]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can block any http user agents with GET / POST requests that scrape your content or try to exploit software vulnerability. Use the following syntax. Edit /usr/local/nginx/conf/nginx.conf file, enter:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You can block any http user agents with GET / POST requests that scrape your content or try to exploit software vulnerability. Use the following syntax. Edit /usr/local/nginx/conf/nginx.conf file, enter:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # vi /usr/local/nginx/conf/nginx.conf&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  # vi /usr/local/nginx/conf/nginx.conf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sol</name></author>
	</entry>
	<entry>
		<id>https://wiki.webko.net.ua/index.php?title=Nginx_Block_User_Agent&amp;diff=135&amp;oldid=prev</id>
		<title>Sol: Новая страница: «You can block any http user agents with GET / POST requests that scrape your content or try to exploit software vulnerability. Use the following syntax. Edit /usr…»</title>
		<link rel="alternate" type="text/html" href="https://wiki.webko.net.ua/index.php?title=Nginx_Block_User_Agent&amp;diff=135&amp;oldid=prev"/>
		<updated>2015-04-21T19:41:54Z</updated>

		<summary type="html">&lt;p&gt;Новая страница: «You can block any http user agents with GET / POST requests that scrape your content or try to exploit software vulnerability. Use the following syntax. Edit /usr…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;You can block any http user agents with GET / POST requests that scrape your content or try to exploit software vulnerability. Use the following syntax. Edit /usr/local/nginx/conf/nginx.conf file, enter:&lt;br /&gt;
 # vi /usr/local/nginx/conf/nginx.conf&lt;br /&gt;
&lt;br /&gt;
== In this example, block http user agent called wget: ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ## Block http user agent - wget ##&lt;br /&gt;
    if ($http_user_agent ~* (Wget) ) {&lt;br /&gt;
    return 403;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
 ## Block Software download user agents ##&lt;br /&gt;
    if ($http_user_agent ~* LWP::Simple|BBBike|wget) {&lt;br /&gt;
            return 403;&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Save and close the file. Reload nginx web server, enter:&lt;br /&gt;
 # service nginx reload&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I block multiple http user agents? ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use the following syntax:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 if ($http_user_agent ~ (agent1|agent2|Foo|Wget|Catall Spider|AcoiRobot) ) {&lt;br /&gt;
 return 403;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Case insensitive blocking: ~* vs ~ ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please note the ~* makes it case insensitive as opposed to just a ~:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 ### case sensitive http user agent blocking  ###&lt;br /&gt;
 if ($http_user_agent ~ (Catall Spider|AcoiRobot) ) { &lt;br /&gt;
    return 403;&lt;br /&gt;
 }&lt;br /&gt;
 ### case insensitive http user agent blocking  ###&lt;br /&gt;
 if ($http_user_agent ~* (foo|bar) ) {&lt;br /&gt;
    return 403;&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Пример ==&lt;br /&gt;
&lt;br /&gt;
   if ($http_user_agent ~* (AhrefsBot|MJ12bot|dobot|BLEXBot) ) {&lt;br /&gt;
    return 403;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
[[Category:Nginx]]&lt;/div&gt;</summary>
		<author><name>Sol</name></author>
	</entry>
</feed>