-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Current Behavior
When running APISIX in an IPv6 environment (e.g., K8s IPv6 SingleStack) with enable_ipv6: true, the standard node_listen and SSL ports correctly bind to [::]. However, ports defined under proxy_protocol (e.g., listen_https_port) fail to create an IPv6 listener and default to IPv4 (0.0.0.0) only.
This causes connection failures for IPv6-only load balancers (like AWS NLB in IPv6 mode) trying to connect via Proxy Protocol.
Expected Behavior
When apisix.enable_ipv6 is set to true in config.yaml, all listening ports configured in APISIX (including proxy_protocol ports) should bind to both IPv4 (0.0.0.0) and IPv6 ([::]) interfaces.
For a configuration defining proxy_protocol.listen_https_port: 9443, the generated nginx.conf should contain the IPv6 listener directive alongside the IPv4 one:
# Expected output in nginx.conf
listen 9443 ssl default_server proxy_protocol;
listen [::]:9443 ssl default_server proxy_protocol; <-- MissingTechnical Details:
The issue appears to be located in ngx_tpl.lua & apisix/cli/ops.lua.
While node_listen and ssl.listen are processed via the listen_table_insert helper function (which correctly injects the [::] entry when enable_ipv6 is true), the proxy_protocol configuration does not follow the same pre-processing steps.
Instead, the raw port number is passed to ngx_tpl.lua, generating a bare listen <port> directive, breaking connectivity in IPv6-only environments.
Error Logs
N/A
Steps to Reproduce
- In
config.yaml, setenable_ipv6: true. - Enable
proxy_protocoland setlisten_https_port: 9443(or any valid port). - Generate the config/start APISIX.
- Check the generated
nginx.conffor the missing[::]listener.
Environment
- APISIX version (run
apisix version): 3.14.1 - Operating system (run
uname -a): 6.12.58-82.121.amzn2023.aarch64 - OpenResty / Nginx version (run
openresty -Vornginx -V): 1.27.1.2 - etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info):
Note: AI helped format this issue. The issue identification and proposed solutions are my own work.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status