Strange rewrite_by_lua outcome

Nginx User nginx at nginxuser.net
Mon Oct 17 17:54:44 UTC 2011


On 17 October 2011 20:45, Tim Mensch <tim-nginx at bitgems.com> wrote:
> On 10/17/2011 10:33 AM, Nginx User wrote:
>> Let me get this right. Do I need to always escape the "\" inserted
>> to escape "." in "\." in lua and then add another couple of "\"s?
>> I.E., do I need to do "sqlpatch\\\\.php" to get "sqlpatch\.php"
>> passed to the regex finally? IOW, do I basically replace each "\"
>> with "\\\\"?
>
> Yes.
Thanks. I had done that anyway and got expected results. Not strictly
changing "\" to "\\\\". It was "\\" to "\\\\\" & "\" to "\\\\"
>
>> If I understand agentzh, the rewrite module handles this behind the
>> scenes and allows us to use familiar syntax. Is that right?
>
> The rewrite module apparently changes how the string is parsed in the Nginx
> file, yes.
Very thoughtful.

Cheers.



More information about the nginx mailing list