Skip to content
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

IPv6 link local interface scoped address breaks nginx config load #1424

Closed
Rycieos opened this issue Apr 19, 2020 · 0 comments
Closed

IPv6 link local interface scoped address breaks nginx config load #1424

Rycieos opened this issue Apr 19, 2020 · 0 comments

Comments

@Rycieos
Copy link

Rycieos commented Apr 19, 2020

Related: #938

My host's /etc/resolv.conf looks like this:

# Generated by NetworkManager
search mydomain.net
nameserver 192.168.1.1
nameserver fe80::728b:cdff:fe86:a470%enp2s0
nameserver 2601:some:vlid:ipv6:addr::1

Which gets copied into the container.
Because of this:

# Compute the DNS resolvers for use in the templates - if the IP contains ":", it's IPv6 and must be enclosed in []
export RESOLVERS=$(awk '$1 == "nameserver" {print ($2 ~ ":")? "["$2"]": $2}' ORS=' ' /etc/resolv.conf | sed 's/ *$//g')

they get copied into the nginx.conf

When nginx loads it, it fails, and enters a restart loop:

dockergen.1 | 2020/04/19 19:19:15 Running 'nginx -s reload'
dockergen.1 | 2020/04/19 19:19:15 Error running notify command: nginx -s reload, exit status 1
nginx.1    | 2020/04/19 19:19:46 [emerg] 31#31: invalid IPv6 address in resolver "[fe80::728b:cdff:fe86:a470%enp2s0]" in /etc/nginx/conf.d/default.conf:36

It seems that nginx can't use an address of the form [ipv6%interface].

I have a work around like so:

export RESOLVERS=$(echo ${RESOLVERS} | sed 's/\[[a-f0-9:]*\%[a-zA-Z0-9]*\] //')

which removes the entry entirely. But maybe there is a way to fix it without removing it?

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

1 participant