Welcome! Log In Create A New Profile


Re: rewrite with $request_uri auto appends args

November 05, 2010 01:49PM
> Classic "redirect everything" example contains
> '?'. See e.g. here:
> http://nginx.org/en/docs/http/converting_rewrite_rules.html
> : server {
> : listen 80;
> : server_name nginx.org;
> : rewrite ^ http://www.nginx.org$request_uri?;
> : }

Well, it sure does. http://wiki.nginx.org/Pitfalls#Taxing_Rewrites does not show the '?' and I (think) I've read many other configurations that don't have it, but perhaps I'm just getting old.

> rewrite is expected to preserve original args in
> all cases (either
> preserve as is, or append if you added other
> arguments) unless you
> specified trailing '?'.

Got it. However, if you use $request_uri, doesn't that always preserve the original args by itself? I'm having trouble thinking of an example where you would NOT want a question mark after $request_uri in a rewrite statement.


Subject Author Posted

rewrite with $request_uri auto appends args

NCRonB November 05, 2010 01:08PM

Re: rewrite with $request_uri auto appends args

Maxim Dounin November 05, 2010 01:30PM

Re: rewrite with $request_uri auto appends args

NCRonB November 05, 2010 01:49PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 270
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready