I am trying to set up an nginx rewrite rule to modify the URL with query request.
E.g.:
www.abc.com/pathA/pathB/script.pl?paraA=10¶B=20
should be rewritten to:
www.abc.com/pathA/pathB/script.pl.1020
I try to use variable $args
or $query_string
(based on the nginx documentation they are the same) to check whether the URL has a query request. But I found $args
(or $query_string
) only has the contents before &
.
In my example, it means $args = paraA=10
. I can't get the parameter contents after &
. I determine this through the nginx error log with the level set to debug.
Any idea why I can't get the query parameters after &
in variable $args
or $query_string
?
The problem is not caused by nginx configuration file. It is caused by I forget double quote when I sent request using curl. E.g.: curl "www.abc.com/pathA/pathB/script.pl?paraA=10¶B=20" Without double quote, "¶B=20" never be sent actually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With