Welcome! Log In Create A New Profile


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).

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: 82
Record Number of Users: 5 on August 04, 2015
Record Number of Guests: 244 on October 02, 2015
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready