Nginx use IPV6 related configuration items to introduce _nginx

Source: Internet
Author: User

IPV4 increasingly scarce, IPv6 has slowly embarked on the agenda, to IPv6 in the domestic popularization, the use of nginx configuration IPv6 that is for sure, see how to let Nginx support IPv6 and configuration.

See if Nginx supports IPv6

Copy Code code as follows:

#/usr/local/nginx-1.7.0/sbin/nginx-v
Nginx version:nginx/1.7.0
Built by GCC 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
Configure arguments:--prefix=/usr/local/nginx-1.7.0--with-http_stub_status_module

No –with-ipv6, indicating that the current nginx does not support IPv6, so we need to recompile nginx, configure the Add –with-ipv6, specifically how to install, I am not long-winded. General YNM installation of the Nginx default has been opened IPv6.

While listening to IPV4 and IPV6.

Copy Code code as follows:

server {
....
Listen [::]:80;
...
}


Monitor IPV6 only

Copy Code code as follows:

server {
....
Listen [::]:80 default Ipv6only=on;
...
}

Listen for the specified IPV6 address
Copy Code code as follows:

server {
....
Listen [3608:f0f0:3002:31::1]:80;
...
}


Restart Nginx
Copy Code code as follows:

/usr/local/nginx-1.7.0/sbin/nginx-s Reload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.