nic-6443 commented on PR #13284:
URL: https://github.com/apache/apisix/pull/13284#issuecomment-4304554811

   Found the real root cause of the nginx.conf parse error. The `--- 
stream_enable` was a red herring.
   
   The actual issue: `"vars": [["route_id", "==", "3"]]` inside the outer 
`[[{...}]]` Lua long bracket string contains `]]` (closing the inner JSON 
array-of-arrays), which **prematurely closes the outer level-0 long bracket 
string**. Nginx's `content_by_lua_block` scanner then exits the Lua block early 
and starts parsing the remaining JSON as nginx config directives — hitting 
`"upstream":` and seeing an unexpected `:`.
   
   Fixed by using a level-1 long bracket string `[=[...]=]` for the outer JSON, 
since `]=]` won't appear in the content.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to