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).
Subject Author Posted

How to use location before rewrite

etrader November 04, 2013 08:51PM

Re: How to use location before rewrite

Francis Daly November 05, 2013 02:36AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 214 on March 20, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready