[GH-ISSUE #307] Configuration Parse Error #166

Closed
opened 2026-02-26 12:07:30 +03:00 by kerem · 2 comments
Owner

Originally created by @tamr on GitHub (Feb 19, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/307

  location = /random  {
      set_by_lua_block $random {
        return math.random(1, 100)
      }
    return 403 "Random number: $random";
   }

This block produces the following error:

Nginx Configuration Parse Error
unexpected token BlockEnd (}) on line 38, column 7

It first appeared like 2 versions ago. With the latest release I noticed the site gets disabled when entering the edit mode (yet it stays enabled on the main page). This is a bit confusing.

Upd: This block may also produce the parse error.

location = /more {
    content_by_lua ' 
         --   more lua code here
    ';
   }
Originally created by @tamr on GitHub (Feb 19, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/307 ``` location = /random { set_by_lua_block $random { return math.random(1, 100) } return 403 "Random number: $random"; } ``` This block produces the following error: ``` Nginx Configuration Parse Error unexpected token BlockEnd (}) on line 38, column 7 ``` It first appeared like 2 versions ago. With the latest release I noticed the site gets disabled when entering the edit mode (yet it stays enabled on the main page). This is a bit confusing. Upd: This block may also produce the parse error. ``` location = /more { content_by_lua ' -- more lua code here '; } ```
kerem 2026-02-26 12:07:30 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Feb 19, 2024):

Thanks for your report, this is a gonginx issue, https://github.com/tufanbarisyildirim/gonginx/issues/20. I will let you know if I fix it.

<!-- gh-comment-id:1952261404 --> @0xJacky commented on GitHub (Feb 19, 2024): Thanks for your report, this is a gonginx issue, https://github.com/tufanbarisyildirim/gonginx/issues/20. I will let you know if I fix it.
Author
Owner

@0xJacky commented on GitHub (Apr 14, 2025):

Fix in 7fc2031, will be released in rc.6.

<!-- gh-comment-id:2801196922 --> @0xJacky commented on GitHub (Apr 14, 2025): Fix in 7fc2031, will be released in rc.6.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#166
No description provided.