8000 fix: replace `$upstream` variable with `BACKEND` env var by theseion · Pull Request #331 · coreruleset/modsecurity-crs-docker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: replace $upstream variable with BACKEND env var #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its 8000 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

Merged

Conversation

theseion
Copy link
Contributor
@theseion theseion commented Feb 6, 2025

proxy_pass will use the resolver whenever the argument contains variables. This isn't usually an issue but it can be if hosts are declared via /etc/hosts, e.g. when useing extra_hosts from docker compose. Then, /etc/hosts would not be considered.

Use the BACKEND variable directly to avoid use of the resolver.

Fixes #330

`proxy_pass` will use the resolver whenever the argument contains
variables. This isn't usually an issue but it can be if hosts are
declared via `/etc/hosts`, e.g. when useing `extra_hosts` from docker
compose. Then, `/etc/hosts` would not be considered.

Use the `BACKEND` variable directly to avoid use of the resolver.

Fixes coreruleset#330
@theseion theseion requested a review from fzipi February 6, 2025 20:16
@fzipi fzipi merged commit 094c358 into coreruleset:main Feb 6, 2025
5 checks passed
@gtaws
Copy link
gtaws commented Feb 6, 2025

Thanks so much! Just to elaborate (because it took me a real long time on Google to figure this out), if proxy_pass sees a variable as its parameter, it will no longer consider /etc/hosts when resolving a host, and only refer the DNS resolver it's been configured to resolve hosts. If proxy_pass sees a literal as its parameter, it will consider /etc/hosts first before referring to the DNS resolver. This is important if you depend on extra_hosts for your container to function correctly.

@theseion theseion deleted the remove-upstream-variable-from-nginx branch February 7, 2025 06:43
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

Successfully merging this pull request may close these issues.

stop using $upstream variable proxy_backend.conf.template for owasp/modsecurity-crs:nginx
3 participants
0