Skip to content

nginx_proxy: Provide option to add configuration parameters to root level of generated nginx conf#4629

Open
emcauliffe wants to merge 4 commits into
home-assistant:masterfrom
emcauliffe:patch-1
Open

nginx_proxy: Provide option to add configuration parameters to root level of generated nginx conf#4629
emcauliffe wants to merge 4 commits into
home-assistant:masterfrom
emcauliffe:patch-1

Conversation

@emcauliffe

@emcauliffe emcauliffe commented May 25, 2026

Copy link
Copy Markdown

Adding a root_conf parameter under options.customize which allows for including a file at the root level of the generated nginx conf. This allows support for features like using NGINX in layer 4 with the stream block.

Summary by CodeRabbit

  • New Features

    • Added a new option to specify a custom root-level NGINX configuration filename that will be loaded when customization is enabled.
  • Documentation

    • Updated customization documentation to explain that enabling customization loads additional NGINX configuration files and how to use the new root-level config option.

@home-assistant home-assistant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @emcauliffe

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant

Copy link
Copy Markdown

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant
home-assistant Bot marked this pull request as draft May 25, 2026 12:48
@emcauliffe
emcauliffe marked this pull request as ready for review May 25, 2026 12:50
@home-assistant
home-assistant Bot dismissed their stale review May 25, 2026 12:50

Stale

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds a new customize.root_conf option, updates the NGINX template to include a root-level config file from /share when customization is active, and documents the new option and the updated customize.active behavior.

Changes

Root configuration customization

Layer / File(s) Summary
Configuration schema and template implementation
nginx_proxy/config.yaml, nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl
Adds customize.root_conf option defaulting to nginx_root_conf*.conf in the config schema. The NGINX template conditionally includes /share/{{ .options.customize.root_conf }} when customize.active is true.
Documentation updates
nginx_proxy/DOCS.md
Updates the customize.active documentation to mention root_conf alongside default and servers as files read from /share. Adds a new required documentation entry for customize.root_conf describing the /share filename for root-level NGINX configuration.

Estimated code review effort: 🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers:

  • sairon
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a new option to include configuration parameters at the root level of the generated nginx configuration file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nginx_proxy/config.yaml`:
- Line 27: The schema is missing the new options.customize.root_conf property,
causing validation to reject or ignore the setting; update the schema.customize
definition to include a root_conf entry (string or pattern as used by
nginx_root_conf*.conf) so options.customize.root_conf is declared and validated,
and ensure the schema field name matches "root_conf" and its type/constraints
mirror how root_conf is used elsewhere (e.g., string with glob pattern or
regex).

In `@nginx_proxy/DOCS.md`:
- Line 67: The docs currently reference a non-existent option name
`root_blocks`; update the text to use the implemented option
`customize.root_conf` instead so it matches config and code. Specifically,
change the sentence that lists `default`, `servers`, and `root_blocks` to list
`default`, `servers`, and `customize.root_conf` (and if helpful, add a brief
note that this option lives under the `customize` namespace). Ensure any other
occurrences of `root_blocks` in DOCS.md are replaced with `customize.root_conf`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 499037de-3de3-4b26-a232-df79e7ef7204

📥 Commits

Reviewing files that changed from the base of the PR and between b4adbd5 and b38cd87.

📒 Files selected for processing (3)
  • nginx_proxy/DOCS.md
  • nginx_proxy/config.yaml
  • nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl

Comment thread nginx_proxy/config.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@nginx_proxy/DOCS.md`:
- Line 67: Update the sentence to reference the fully qualified configuration
keys instead of the generic word "variables": mention `customize.default`,
`customize.servers`, and `customize.root_conf` explicitly so the docs match the
configuration contract and remove ambiguity.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0cecac0-c7f1-48c8-a053-d2b9c534b963

📥 Commits

Reviewing files that changed from the base of the PR and between b38cd87 and 61508f7.

📒 Files selected for processing (1)
  • nginx_proxy/DOCS.md

Comment thread nginx_proxy/DOCS.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant