Ubuntu 20.04.3
nginx version: nginx/1.18.0 (Ubuntu)
Hello,
I just followed a simple procedure to set ngnix to listen to a specific IPv6 address
https://geekflare.com/enable-ipv6-nginx-apache/ and we encountered an error. Below are some relevant info:
ip a |g inet6
Code:
inet6 ::1/128 scope host
inet6 fe80::6e35:7039:2681:db1f/64 scope link noprefixroute
inet6 fe80::42:d3ff:feaf:2ad/64 scope link
changed /etc/nginx/sites-available/default to listen to IPv6 address, note the '[]' were included:
Code:
listen [fe80::6e35:7039:2681:db1f]:80 default_server;
no other servers listen on p:80:
Code:
lsof -i :80 | grep LISTEN
and succesfully fails:
Code:
nginx[16359]: nginx: [emerg] bind() to [fe80::6e35:7039:2681:db1f]:80 failed (22: Invalid argument)
found out something weird at least at my level of understanding I do not know if it is related but I do not think that is what ping should normally reply:
Code:
ping -I wlp4s0 fe80::6e35:7039:2681:db1f
ping: Warning: source address might be selected on device other than: wlp4s0
PING fe80::6e35:7039:2681:db1f(fe80::6e35:7039:2681:db1f) from :: wlp4s0: 56 data bytes
However
Code:
ping fe80::6e35:7039:2681:db1f%wlp4s0
PING fe80::6e35:7039:2681:db1f%wlp4s0(fe80::6e35:7039:2681:db1f%wlp4s0) 56 data bytes
64 bytes from fe80::6e35:7039:2681:db1f%wlp4s0: icmp_seq=1 ttl=64 time=0.060 ms
64 bytes from fe80::6e35:7039:2681:db1f%wlp4s0: icmp_seq=2 ttl=64 time=0.104 ms
works but I do not know how to add this workaround to /etc/nginx/sites-available/default
Thanks!