Nginx 1.2.3 Rewrite Issue

Wierd problem with Nginx 1.2.3 rewrites.

See http://pastie.org/4433865 and note Line 30. The arg is part of the
main url. Results in a 404 not found as the final url becomes
“/test/index.php?x2_SID=41efad7adffaa9d25967dc913919cbc0?x2_SID=41efad7adffaa9d25967dc913919cbc0”

Any cluees

Hello!

On Thu, Aug 09, 2012 at 05:13:53PM +0300, Nginx U. wrote:

Wierd problem with Nginx 1.2.3 rewrites.

See http://pastie.org/4433865 and note Line 30. The arg is part of the
main url. Results in a 404 not found as the final url becomes

“/test/index.php?x2_SID=41efad7adffaa9d25967dc913919cbc0?x2_SID=41efad7adffaa9d25967dc913919cbc0”

Any cluees

It’s not clear what you are trying to do, but if you just want to
preserve arguments as is - there is no need to write anything
extra, just

rewrite ^/test/index.html$ /test/index.php last;

Original request arguments (if any) will be preserved as is.

Maxim D.

Ha! Got it. I was trying to preserve arguments indeed.

I take it this is related to needing to add a “?” to the end of such
to prevent the args being appended again. Right?

Hello!

On Thu, Aug 09, 2012 at 05:26:40PM +0300, Nginx U. wrote:

Ha! Got it. I was trying to preserve arguments indeed.

I take it this is related to needing to add a “?” to the end of such
to prevent the args being appended again. Right?

For sure.

Maxim D.