Tricky Rewrite rules.

Hone developerhondev at gmail.com
Tue Nov 20 23:15:56 MSK 2007


I think something like this:

        if ($query_string ~ "..(..)..") {
            set       $var  $1;
            rewrite   ...    ...$var...
        }

On Mon, 2007-11-19 at 07:30 +0100, Gustavo Barrón wrote:
> HonDev Developer wrote:
> > By the way I don't think you'll need to  use the gzip component of
> > wp-super-cache on nginx since nginx already has on the fly gzip.
> > (compression as I understand it.)
> 
> Yeah I forgot to tell that nginx is already serving gzip files, but on 
> big scenarios, with many users, serving a precompressed file instead of 
> doing it on the fly, would help greatly on the performance.
> 
> also insted of:
> 
>     if (-f /wp-content/cache/supercache/mydomain.com/$1index.html ) {
>       rewrite ^(.*)$ 
> /wp-content/cache/supercache/mydomain.com/$1index.html last;
>     }
> 
> I was trying to do something like
> 
>     if (-f /wp-content/cache/supercache/mydomain.com/$uriindex.html ) {
>       rewrite ^(.*)$ 
> /wp-content/cache/supercache/mydomain.com/$uriindex.html last;
>     }
> 
> But obviously returns a error, is there a way of a) setting a variable 
> on nginx b)escape the i on index.html in order to separate the variable 
> from the text when the config is parsed.
> 
> 
-- 
http://www.honewatson.com






More information about the nginx mailing list