Welcome! Log In Create A New Profile

Advanced

How to use location before rewrite

November 04, 2013 08:51PM
I have a set of rewrite rules as

rewrite ^/(.*) /script.php?file=$1 last;

location ~ \.php$ {
php proxy
}

but I want to make a few exceptions as

location = file1|file2|file3 {
static delivery
}

but rewrite will change any static file to php file before the latter location.

I cannot use rewrite inside the location, as it should generate php script before location (and I have other locations for subdirectories too).
SubjectAuthorPosted

How to use location before rewrite

etraderNovember 04, 2013 08:51PM

Re: How to use location before rewrite

Francis DalyNovember 05, 2013 02:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready