rewrite except one directory

Francis Daly francis at
Sun Feb 16 09:48:12 UTC 2014

On Sun, Feb 16, 2014 at 07:58:33AM +0100, Philipp Kraus wrote:

Hi there,

> So I would like to disable the rewrite for one subfolder. I have some PHP scripts with should not use the
> rewrite call e.g. http://myserver/scripts/script1.php. All scripts with are in the /script location should not
> use the rewrite to the index.
> How can I do this?

The same way any prefix-based nginx config would be done, unless there's
a reason it fails?

location ^~ /scripts/ {
 # do your /scripts/ stuff
location / {
 # do everything else

Francis Daly        francis at

More information about the nginx mailing list