Skip to content

Block directives of nginx site.conf are not supported #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pavel-shvagirev opened this issue Mar 31, 2025 · 2 comments
Closed

Block directives of nginx site.conf are not supported #643

pavel-shvagirev opened this issue Mar 31, 2025 · 2 comments

Comments

@pavel-shvagirev
Copy link

👻 Brief Description

nginx site.conf's "block directives" are not supported: template adds semicolon at the end of line, which leads to nginx test failure (block directives must not have semicolon at the end of line)

🥞 Cookbook version

12.2.13

👩‍🍳 Chef-Infra Version

18.6.2

🎩 Platform details

nginx version: nginx/1.27.4

Steps To Reproduce

    '~ ^(.*)$' => {
      'limit_except' => node['limit_except'],
    },

where limit_except is a role-defined attr:
"limit_except": "GET POST { deny all; }",

that leads to template rendering that string with semicolon at the end which fails nginx -t

🚓 Expected behavior

block directives of site.conf should be rendered without semicolon at the end

@pavel-shvagirev
Copy link
Author

Frankly, this looks like a total usage blocker unlike #644 since there is no ways other than no use of such directives (like limit_except which is quite usefull), or, again, move everything to an includes...

@bmhughes
Copy link
Contributor

bmhughes commented Apr 1, 2025

Thanks for the the report @pavel-shvagirev, the next release should correct this.

bmhughes added a commit that referenced this issue Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants