Clean-URL rewrite rule with nested "location" and alias directive

Francis Daly francis at
Tue Nov 19 17:38:09 UTC 2013

On Tue, Nov 19, 2013 at 10:36:53AM -0500, Ben Johnson wrote:

Hi there,

> This works as expected, with one major exception: "clean-URL" rewriting
> does not work. In other words, the homepage (/stage/) loads correctly,
> but all sub-pages return a 404. As soon as I attempt to add "rewrite"
> directives for clean-URLs, the server either returns a 500 (redirect
> cycle) or "Primary script unknown".

Can you give an example of a "clean-URL" that matches the location that
you use, and that does not do what you want it to do?

Note that your rewrite only happens for urls that end ".php".

Francis Daly        francis at

More information about the nginx mailing list