nginx ipv6 proxy配置

方式一:采用upstream方式

upstream npmgmt.net.cmft { 
  server 10.126.11.4:7070 weight=1 fail_timeout=10s max_fails=1 ;
  server [2409:8095:8110:1006::a7f:b60a]; 
}
  server {
    server_name npmgmt.net.cmft;
        listen 80;
     #listen [::]:80;
    location / {
      proxy_pass http://npmgmt.net.cmft/;
        }
  }

 

方式二:采用server方式

 
server {
    server_name npmgmt.net.cmft;
    listen [::]:80 ipv6only=on;
    location / {
      proxy_pass http://[2409:8095:8110:1006::a7f:b60a]/;
        }
  }
  server {
    server_name npmgmt.net.cmft;
    listen 80;
    location / {
      proxy_pass http://10.126.11.4:7070/;
        }
  }

 


 

posted @ 2025-09-25 16:48  hopeccie  阅读(8)  评论(0)    收藏  举报