Rewrite except for single uri

Cherife Li cherife at dotimes.com
Tue Aug 4 07:01:36 MSD 2009


On Tue, 04 Aug 2009 at 09:22:05 +1000, Edward Stow wrote:

> 2009/8/3 Igor Sysoev <is at rambler-co.ru>:
> 
> >     root   /srv/www/abc.tld/html;
> >
> >     location = / {
> >         index  buy.html;
> >         ssi    on;
> >     }
> >
> >     location = /buy.html {
> >         ssi    on;
> >     }
> >
> >     location / {
> >         rewrite  ^ http://abc.tld/$request_uri?;
> >     }
> >
> Thanks,  The / needed to be removed.  Otherwise you end up with double slashes.
> 
>     location / {
>          rewrite  ^ http://abc.tld$request_uri?;
>      }
> 
> What does the question mark ? do.

It's mentioned here:
  <http://wiki.nginx.org/NginxHttpRewriteModule#rewrite>

<quote>
If in the line of replacement arguments are indicated, then the rest of
the request arguments are appended to them. To avoid having them
appended, place a question mark as the last character
</quote>

but I haven't understood it clearly.
> 
> Is there a page that describes all the special variables in nginx.

<http://wiki.nginx.org/NginxHttpMainModule#Variables>
<http://wiki.nginx.org/NginxHttpCoreModule#Variables>
-- 
Rgds,
Cherife.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20090804/57d1ac83/attachment.pgp>


More information about the nginx mailing list