os-nginx: Expand Trusted Proxies network aliases when generating nginx configuration
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 54/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- nginx, php
- Ambito
- backend, networking
Direzione di ricerca
Start by locating the os-nginx code that generates set_real_ip_from directives for Trusted Proxies and trace how it resolves a Networks alias that references a URL Table alias. Check how the current PF table entries can be read when nginx configuration is generated or reloaded. Done means each supported entry produces a valid IP or CIDR directive and nginx configuration validation succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
When a Networks alias references a URL Table (IPs) alias, selecting the Networks alias as the nginx plugin's Trusted Proxies generates an invalid nginx configuration.
The URL Table contains Cloudflare's IPv4 and IPv6 proxy CIDR ranges, and the corresponding PF table is correctly populated. However, the generated nginx configuration contains a directive such as:
set_real_ip_from Cloudflare_Proxy_IPs_Table;
nginx expects an IP address or CIDR range in set_real_ip_from, not a PF alias or table name. Consequently, nginx configuration validation fails with the following error:
nginx: [emerg] host not found in set_real_ip_from "Cloudflare_Proxy_IPs_Table" in /usr/local/etc/nginx/nginx.conf:1146
To Reproduce
- Create a
URL Table (IPs)alias containing Cloudflare's proxy IP ranges. - Create a
Networksalias that references the URL Table alias. - Configure an nginx virtual server to use the
Networksalias as its Trusted Proxies. - Apply or reload the nginx configuration.
- Observe that the generated configuration references the alias name instead of actual IP addresses or CIDR ranges.
- Run
nginx -Tand observe that configuration validation fails.
Expected behavior
The nginx plugin should expand supported network aliases into their actual IP addresses and CIDR ranges when generating its configuration. For example, it could retrieve the current entries from the corresponding PF table using an equivalent of pfctl -t <table_name> -T show and generate valid set_real_ip_from directives for those entries.
Expanding the current table contents when generating or reloading the nginx configuration would be sufficient. Automatically regenerating the configuration whenever the URL Table changes is not required.
Screenshots
Not applicable.
Environment
- OPNsense: 26.7.6_3-amd64
- os-nginx: 1.36_5
- Architecture: amd64
Additional context
This affects the use of Cloudflare proxy IP ranges with nginx's real-IP functionality. Maintaining a separate static Networks alias containing all Cloudflare CIDRs works around the problem, but requires manual updates when Cloudflare changes its published ranges.
Existing issue #3471 discusses support for additional alias types in Trusted Proxies. This report concerns a related but distinct failure: a Networks alias is accepted by the GUI, but referencing a URL Table alias causes the generated nginx configuration to be invalid.
- Lingua principale
- PHP
- Stelle
- 1.2k
- Fork
- 926
- Merge medio
- 1g 10h
- PR unite (30g)
- 25
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opnsense/plugins
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
opnsense/plugins#5976 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directiveApertaincomplete
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
opnsense/plugins#5973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Forse già presa @bringha1 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
q-feeds-connector: "error in configd communication" every update when the Unbound DNSBL rebuild takes longer than 120sForse già presa @mhatipog l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opnsense/plugins
Issue simili
-
15.0
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
open-telemetry/opentelemetry-php-distro#176 ·
I maintainer di solito rispondono entro 2 giorni
-
No Code Attached Yet
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
joomla/joomla-cms#48941 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage Platform(Default)
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug new
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
moodle-an-hochschulen/moodle-theme_boost_union#1500 ·
I maintainer di solito rispondono entro 1 giorno