Articles in this section

Nginx cannot bind to IPv6 interface on Plesk with error: Cannot assign requested address

Plesk for Linux kb: technical nginx

Symptoms

  • Error in Plesk UI:

    CONFIG_TEXT: New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] bind() to 2001:db8:f61:a1ff:0:0:0:80:443 failed (99: Cannot assign requested address) nginx: configuration file /etc/nginx/nginx.conf test failed. Detailed error descriptions were sent to you by email. To fix the issue, follow the instructions described in KB: https://support.plesk.com/hc/articles/213933865 Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter

  • Error in /var/log/nginx/error.log:

    CONFIG_TEXT: [emerg] 290143#0: bind() to [2001:db8:f61:a1ff:0:0:0:80]:443 failed (99: Cannot assign requested address)
    [emerg] 290210#0: bind() to [2001:db8:f61:a1ff:0:0:0:80]:443 failed (99: Cannot assign requested address)

Cause

Nginx configuration tests are done before the IPv6 address is fully added to the system.

Resolution

Allow daemons to bind to non-existing IPv6 network interfaces to help pass the Nginx configuration test with the next steps:

1. Connect to the server via SSH

2. Add the following string to the bottom of the /etc/sysctl.conf file:

CONFIG_TEXT: net.ipv6.ip_nonlocal_bind = 1

3.  Restart the nginx service:

# systemctl restart nginx

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.