<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>How to convert to nginx</title>
<description>Hello,

I moved from apache to nginx. But rewrite doesn't work. Please tell me how to convert below rewrite rules to nginx:

&amp;lt;IfModule mod_rewrite.c&amp;gt;
RewriteEngine On

RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\&amp;lt;|%3C).*script.*(\&amp;gt;|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteCond %{QUERY_STRING} SELECT(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} UNION(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} UPDATE(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteRule ^(.*)$ index.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
&amp;lt;/IfModule&amp;gt;



Thanks.</description><link>http://forum.nginx.org/read.php?9,222904,222904#msg-222904</link><lastBuildDate>Thu, 20 Jun 2013 06:57:32 -0400</lastBuildDate>
<generator>Phorum 5.2.16</generator>
<item>
<guid>http://forum.nginx.org/read.php?9,222904,222967#msg-222967</guid>
<title>Re: How to convert to nginx</title><link>http://forum.nginx.org/read.php?9,222904,222967#msg-222967</link><description><![CDATA[Finally it works for me:<br /><br />if ($args ~ &quot;base64_encode.*(.*)&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~* &quot;(&lt;|%3C).*script.*(&gt;|%3E)&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~ &quot;GLOBALS(=|[|%[0-9A-Z]{0,2})&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~ &quot;_REQUEST(=|[|%[0-9A-Z]{0,2})&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~ &quot;SELECT(=|[|%[0-9A-Z]{0,2})&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~ &quot;UNION(=|[|%[0-9A-Z]{0,2})&quot;){<br />set $rule_0 1;<br />}<br />if ($args ~ &quot;UPDATE(=|[|%[0-9A-Z]{0,2})&quot;){<br />set $rule_0 1;<br />}<br />if ($rule_0 = &quot;1&quot;){<br />rewrite ^/(.*)$ /index.php last;<br />}<br />if (!-f $request_filename){<br />set $rule_1 1$rule_1;<br />}<br />if (!-d $request_filename){<br />set $rule_1 2$rule_1;<br />}<br />if ($rule_1 = &quot;21&quot;){<br />rewrite ^/(.*)$ /index.php?q=$1 last;<br />}<br />}]]></description>
<dc:creator>minhte</dc:creator>
<category>Migration from Other Servers</category><pubDate>Fri, 24 Feb 2012 15:46:55 -0500</pubDate></item>
<item>
<guid>http://forum.nginx.org/read.php?9,222904,222904#msg-222904</guid>
<title>How to convert to nginx</title><link>http://forum.nginx.org/read.php?9,222904,222904#msg-222904</link><description><![CDATA[Hello,<br /><br />I moved from apache to nginx. But rewrite doesn't work. Please tell me how to convert below rewrite rules to nginx:<br /><br />&lt;IfModule mod_rewrite.c&gt;<br />RewriteEngine On<br /><br />RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]<br />RewriteCond %{QUERY_STRING} (\&lt;|%3C).*script.*(\&gt;|%3E) [NC,OR]<br />RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]<br />RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})<br />RewriteCond %{QUERY_STRING} SELECT(=|\[|\%[0-9A-Z]{0,2}) [OR]<br />RewriteCond %{QUERY_STRING} UNION(=|\[|\%[0-9A-Z]{0,2}) [OR]<br />RewriteCond %{QUERY_STRING} UPDATE(=|\[|\%[0-9A-Z]{0,2}) [OR]<br />RewriteRule ^(.*)$ index.php [L,QSA]<br /><br />RewriteCond %{REQUEST_FILENAME} !-f<br />RewriteCond %{REQUEST_FILENAME} !-d<br />RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]<br />&lt;/IfModule&gt;<br /><br /><br /><br />Thanks.]]></description>
<dc:creator>minhte</dc:creator>
<category>Migration from Other Servers</category><pubDate>Thu, 23 Feb 2012 13:03:59 -0500</pubDate></item>
</channel>
</rss>