On Tue, Nov 23, 2010 at 11:42:38PM -0500, daveyfx wrote:
> Francis Daly Wrote:
> -------------------------------------------------------
>
> > Assuming that this sentence describes your wish:
> >
> > location = /preview.php {
> > rewrite ^ /? permanent;
> > }
> >
> > (untested!) should probably Just Work.
> >
> > If you *do* want to vary based on the query string
> > (?-bit), the manual
> > has an example.
> >
> > Good luck,
> >
> > f
> > --
> > Francis Daly francis@daoine.org
>
> Francis,
>
> Spot on. That seems to have done the trick. Out of my own desire to
> learn, is there a way to do the same thing without using the location
> directive, and just merely using a rewrite statement?
You can place the rewrite on server level, but it's better to use
the location, because otherwise nginx will run regex "^/preview\.php$" for
every request. Testing "location = /preview.php" is faster.
--
Igor Sysoev
http://sysoev.ru/en/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx