Hello guys, I run into infamous nginx + ipv6 problem. On my server I run several virtual hosts on both ipv4 and ipv6. The ipv6 works as expected - but I cannot renew/obtain the certificate as soon as I set AAAA record on the domain, since certbot prefers ipv6.
This is my default_server catch-all host:
server
{
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
include /etc/nginx/snippets/letsencrypt.conf;
}
This works perfectly when using host which run on ipv4 but as soon as I try to use ipv4+ipv6 host (the above one) i run into the problem. Can anyone help me?
My domain is: upczone.cz
I ran this command: certbot-auto certonly --webroot -w /var/www -d upczone.cz --dry-run
rg305: Thank you for the quick reply! Thought I’m not sure what’s wrong with my Nginx config, as it seems correct to me. The server listens on both ipv4 and ipv6 and redirects everything to https://www.upczone.cz, this configuration works on ipv4 without no problem.
server
{
listen 80;
listen [::]:80;
server_name upczone.cz www.upczone.cz;
include /etc/nginx/snippets/letsencrypt.conf;
return 301 https://www.upczone.cz$request_uri;
}
while https server pass the request further to the upstream:
server
{
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.upczone.cz;
ssl_certificate /etc/letsencrypt/live/upczone.cz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/upczone.cz/privkey.pem;
include /etc/nginx/snippets/proxy_pass_apache2.conf;
}
Could you please explain me little bid more? I’m pretty new to ipv6 … unfortunately.
Both IP addresses are routed to the same server and works correctly, the problem seems to be that nginx does not set the correct response for the curl -Iki6 http://upczone.cz/ as rg305 mentioned.
Since LE prefers IPv6 and starts with HTTP, you are unable to complete their initial request (http://IPv6)
[which never gets forwards to https and never finds the authentication token to complete your request]