无法分配请求的地址

openssl req -new -x509 -days 8192 -newkey rsa:4096 -extensions v3_ca -config conf / caconfig.cnf -keyform PEM -keyout private /key.ca.pem -outform PEM -out certs / crt.ca.pem

我现在正在使用nginx与IPv6结合使用,现在没有任何问题,但是当尝试部署SSL时,失败, bind() to [...]:443 failed (99: Cannot assign requested address)

nginxconfiguration(无服务器名称等):

 # Works like a charm server { listen 80; listen [2a03:4000:2:3c8:6e65:6f6b:6572:80]:80; return 301 https://$host$request_uri; } # Cannot assign requested address server { listen 443 ssl; listen [2a03:4000:2:3c8:6e65:6f6b:6572:443]:443 ssl; #... } 

使用最后两个字节的IPv6地址作为端口,就像其他服务一样具有魅力。 没有其他服务使用:443或该地址(通过ip addr show地址validationip addr show不提及它)。

您不能listen您的服务器实际上没有在其某个接口上configuration的地址。 你说,你的服务器的networking接口没有configuration为该地址。

要解决此问题,请将该地址添加到您的networking接口configuration中。

你也应该考虑让nginx绑定到任何地址,例如listen [::]:443 ssl