zoukankan      html  css  js  c++  java
  • nginx 支持ipv6设置

    为了使nginx支持ipv6 访问需要做以下配置:

    1、找到nginx的安装路径:

     使用命令:whereis nginx 查看nginx安装路径:

    进入nginx执行文件目录:

    先用./nginx -V 查看已安装的模块

    如果有--with-ipv6,则表示已安装此模块,否则需要重新编译安装

    进入nginx解压文件目录:

    # 按需添加编译参数
    

    ./configure --prefix=/usr/local/software/nginx/ --with-ipv6( --with-ipv6必须加,让nginx开启IPV6支持配置)

    
    #编译源码
    make
    #安装
    make install
    或者:
    ./configure --prefix=/usr/local/software/nginx/ --with-ipv6 && make && make install 安装到指定路径

    2、nginx配置增加ipv6监听,负载均衡也修改为ipv6地址

    Linux 开放ipv680端口

    ip6tables -I INPUT -p tcp --dport 80 -j ACCEPT

    Service ip6tables save

     或者以下方式访问

    配置同时支持v4 v6

    listen 80;
    listen [::]:80 ipv6only=on;

  • 相关阅读:
    SVN版本控制服务
    JVM内存结构
    Git的使用
    Nginx详解
    Apache(httpd)详解
    rsyslog日志收集器
    nsswitch名称解析框架
    NFS网络文件系统
    ThreadLocal详解
    RocketMQ踩坑记
  • 原文地址:https://www.cnblogs.com/pinghengxing/p/10034200.html
Copyright © 2011-2022 走看看