How to rewrite this on nginx?

apache .htaccess

Rewriteengine on
Rewriteengine ^search.shtml$ /search.cgi%{QUERY_STRING}
Rewriteengine ^([^.])/([^.])/([^.]*].html$ index.cgi?t=$1&c1=$1&p=$3

Anyone knows?

2010/4/12 lhmwzy [email protected]:

On Mon, Apr 12, 2010 at 12:02 PM, lhmwzy [email protected] wrote:

apache .htaccess

Rewriteengine on
Rewriteengine ^search.shtml$ Â /search.cgi%{QUERY_STRING}
Rewriteengine  ^([^.])/([^.])/([^.]*].html$ index.cgi?t=$1&c1=$1&p=$3

location = /search.shtml {
rewrite ^ /search.cgi?$args;
}

location ~ ^[^.]/[^.]/[^.].html$ {
rewrite ^/([^.]
)/([^.])/([^.]].html$ /index.cgi?t=$1&c1=$1&p=$3;
}

smarter way would be by replacing the rewrites with direct fastcgi (or
proxy) settings


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Hello lhmwzy,

Friday, April 16, 2010, 1:26:37 PM, you wrote:

Anyone knows?

2010/4/12 lhmwzy [email protected]:

apache .htaccess

Rewriteengine on
Rewriteengine ^search.shtml$ /search.cgi%{QUERY_STRING}
Rewriteengine ^([^.])/([^.])/([^.]*].html$ index.cgi?t=$1&c1=$1&p=$3

location = /search.shtml {
proxy_pass http://backend_ip/search.cgi;
}

location ~ ^/([^./])/[^./]/([^./]*]).html$ {
proxy_pass http://backend_ip/index.cgi?t=$1&c1=$1&p=$2;
}

or

location ~ ^/([^./])/([^./])/([^./]*]).html$ {
proxy_pass http://backend_ip/index.cgi?t=$1&c1=$2&p=$3;
}

depends on what typo u did.


Best regards,
Denis mailto:[email protected]