关于Nginx的默认虚拟主机和IPv6双栈设置

原来写了一大堆,结果发现,只需要在默认 server 段中写:

listen 80 default_server;
listen [::]:80 default_server;

在其他 server 段中写:

listen 80;
listen [::]:80;

即可达到同时监听 IPv4 和 IPv6 的效果。

One thought on “关于Nginx的默认虚拟主机和IPv6双栈设置”

Leave a Reply

Your email address will not be published. Required fields are marked *

40 − = 34