How to rewrite this on nginx?

Denis F. Latypoff denis at gostats.ru
Fri Apr 16 10:37:48 MSD 2010


Hello lhmwzy,

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

> Anyone knows?

> 2010/4/12 lhmwzy <lhmwzy at gmail.com>:
>> 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:denis at gostats.ru




More information about the nginx mailing list