Please convert this .htaccess to NGINX rewrite

could somebody convert this .htaccess to NGINX rewrite,??
i need it stop my forum from automatic bot poster…

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.(6a1pre). [NC]
RewriteRule ^(.*)$ - [F,L]

if u could help me, u’re the best !

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,162173,162173#msg-162173

On 30 Dez 2010 08h06 WET, [email protected] wrote:

could somebody convert this .htaccess to NGINX rewrite,??
i need it stop my forum from automatic bot poster…

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.(6a1pre). [NC]
RewriteRule ^(.*)$ - [F,L]

if ($http_user_agent ~* “^.(6a1pre).”) {
return 403;
}

— appa

its not working, :frowning: i think its not true antonio…

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,162173,171085#msg-171085

On 31 Jan 2011 15h55 WET, [email protected] wrote:

its not working, :frowning: i think its not true antonio…

It should work. But the User Agent string must contain ‘(6a1pre)’.

You can test it yourself with wget.

wget -U ‘This is a test of the evil UA (6a1pre) indeed’

you should get a 403 status code as the result.

— appa

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs