mirror of
				https://github.com/v2fly/v2ray-examples.git
				synced 2025-11-04 20:05:39 +08:00 
			
		
		
		
	adjust name
This commit is contained in:
		
							
								
								
									
										145
									
								
								Websocket+Nginx+TLS/config_client.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								Websocket+Nginx+TLS/config_client.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,145 @@
 | 
			
		||||
{
 | 
			
		||||
  "outbound": {
 | 
			
		||||
    "protocol": "freedom",
 | 
			
		||||
    "settings": {},
 | 
			
		||||
    "tag": "direct"
 | 
			
		||||
  },
 | 
			
		||||
  "inboundDetour": [
 | 
			
		||||
    {
 | 
			
		||||
      "port": 1086,
 | 
			
		||||
      "listen": "127.0.0.1",
 | 
			
		||||
      "protocol": "socks",
 | 
			
		||||
      "settings": {
 | 
			
		||||
        "auth": "noauth",
 | 
			
		||||
        "timeout": 300,
 | 
			
		||||
        "udp": true
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "outboundDetour": [
 | 
			
		||||
    {
 | 
			
		||||
      "mux": {
 | 
			
		||||
        "concurrency": 6,
 | 
			
		||||
        "enabled": true
 | 
			
		||||
      },
 | 
			
		||||
      "protocol": "vmess",
 | 
			
		||||
      "settings": {
 | 
			
		||||
        "vnext": [
 | 
			
		||||
          {
 | 
			
		||||
            "users": [
 | 
			
		||||
              {
 | 
			
		||||
                "id": "97c0ec9c-dc4e-11e7-9296-cec278b6b50a",
 | 
			
		||||
                //"level"字段与"policy"字段中的"levels"字段中的对应,默认值:0,注:需要core≥3.1
 | 
			
		||||
                "level": 0,
 | 
			
		||||
                "alterId": 0,
 | 
			
		||||
                "security": "aes-128-cfb"
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            "address": "domain.Name",
 | 
			
		||||
            "port": 443
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "streamSettings": {
 | 
			
		||||
        "tlsSettings": {
 | 
			
		||||
          "allowInsecure": false
 | 
			
		||||
        },
 | 
			
		||||
        "wsSettings": {
 | 
			
		||||
          "headers": {
 | 
			
		||||
            "Host": "domain.Name"
 | 
			
		||||
          },
 | 
			
		||||
          "path": "/PATH/"
 | 
			
		||||
        },
 | 
			
		||||
        "network": "ws",
 | 
			
		||||
        "security": "tls"
 | 
			
		||||
      },
 | 
			
		||||
      "tag": "proxy"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "blackhole",
 | 
			
		||||
      "settings": {},
 | 
			
		||||
      "tag": "block"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "dns": {
 | 
			
		||||
    "servers": [
 | 
			
		||||
      "8.8.8.8",
 | 
			
		||||
      "8.8.4.4"
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "inbound": {
 | 
			
		||||
    "port": 1087,
 | 
			
		||||
    "listen": "127.0.0.1",
 | 
			
		||||
    "protocol": "http",
 | 
			
		||||
    "settings": {
 | 
			
		||||
      "timeout": 300
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  // 注"policy"字段需要core≥3.1
 | 
			
		||||
  "policy": {
 | 
			
		||||
    "levels": {
 | 
			
		||||
      "0": {
 | 
			
		||||
        "uplinkOnly": 0,
 | 
			
		||||
        "downlinkOnly": 0,
 | 
			
		||||
        "connIdle": 150,
 | 
			
		||||
        "handshake": 4
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "routing": {
 | 
			
		||||
    "settings": {
 | 
			
		||||
      "rules": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "field",
 | 
			
		||||
          "domain": [
 | 
			
		||||
            "geosite:cn"
 | 
			
		||||
          ],
 | 
			
		||||
          "outboundTag": "direct"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "field",
 | 
			
		||||
          "domain": [
 | 
			
		||||
            "google",
 | 
			
		||||
            "facebook",
 | 
			
		||||
            "youtube",
 | 
			
		||||
            "twitter",
 | 
			
		||||
            "instagram",
 | 
			
		||||
            "gmail",
 | 
			
		||||
            "domain:twimg.com",
 | 
			
		||||
            "domain:t.co"
 | 
			
		||||
          ],
 | 
			
		||||
          "outboundTag": "proxy"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "field",
 | 
			
		||||
          "ip": [
 | 
			
		||||
            "8.8.8.8/32",
 | 
			
		||||
            "8.8.4.4/32",
 | 
			
		||||
            "91.108.56.0/22",
 | 
			
		||||
            "91.108.4.0/22",
 | 
			
		||||
            "109.239.140.0/24",
 | 
			
		||||
            "149.154.164.0/22",
 | 
			
		||||
            "91.108.56.0/23",
 | 
			
		||||
            "67.198.55.0/24",
 | 
			
		||||
            "149.154.168.0/22",
 | 
			
		||||
            "149.154.172.0/22"
 | 
			
		||||
          ],
 | 
			
		||||
          "outboundTag": "proxy"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          "type": "field",
 | 
			
		||||
          "ip": [
 | 
			
		||||
            "192.168.0.0/16",
 | 
			
		||||
            "10.0.0.0/8",
 | 
			
		||||
            "172.16.0.0/12",
 | 
			
		||||
            "127.0.0.0/8",
 | 
			
		||||
            "geoip:cn"
 | 
			
		||||
          ],
 | 
			
		||||
          "outboundTag": "direct"
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      "domainStrategy": "IPIfNonMatch"
 | 
			
		||||
    },
 | 
			
		||||
    "strategy": "rules"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										103
									
								
								Websocket+Nginx+TLS/config_client_ver4.2.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								Websocket+Nginx+TLS/config_client_ver4.2.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,103 @@
 | 
			
		||||
{
 | 
			
		||||
  "log": {
 | 
			
		||||
    "loglevel": "debug"
 | 
			
		||||
  },
 | 
			
		||||
  "inbounds": [
 | 
			
		||||
    {
 | 
			
		||||
      "port": 10086,
 | 
			
		||||
      "listen": "0.0.0.0",
 | 
			
		||||
      "tag": "socks-in",
 | 
			
		||||
      "protocol": "socks",
 | 
			
		||||
      "settings": {
 | 
			
		||||
        "auth": "noauth",
 | 
			
		||||
        "udp": false
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "port": 1087,
 | 
			
		||||
      "listen": "0.0.0.0",
 | 
			
		||||
      "tag": "http-in",
 | 
			
		||||
      "protocol": "http",
 | 
			
		||||
      "settings": {}
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "outbounds": [
 | 
			
		||||
    {
 | 
			
		||||
      "mux": {
 | 
			
		||||
        "concurrency": 32,
 | 
			
		||||
        "enabled": true
 | 
			
		||||
      },
 | 
			
		||||
      "protocol": "vmess",
 | 
			
		||||
      "settings": {
 | 
			
		||||
        "vnext": [
 | 
			
		||||
          {
 | 
			
		||||
            "users": [
 | 
			
		||||
              {
 | 
			
		||||
                //注:填写uuid
 | 
			
		||||
                "id": "UUID",
 | 
			
		||||
                "alterId": 64,
 | 
			
		||||
                "security": "auto"
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            //注:填写域名、端口
 | 
			
		||||
            "address": "domain.Name",
 | 
			
		||||
            "port": 1234
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "streamSettings": {
 | 
			
		||||
        "tlsSettings": {
 | 
			
		||||
          "allowInsecure": false
 | 
			
		||||
        },
 | 
			
		||||
        "wsSettings": {
 | 
			
		||||
          "headers": {
 | 
			
		||||
            "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.4489.62 Safari/537.36",
 | 
			
		||||
            //注:填写对应头部
 | 
			
		||||
            "Host": "HOST",
 | 
			
		||||
            "Accept-Encoding": "gzip",
 | 
			
		||||
            "Pragma": "no-cache"
 | 
			
		||||
          },
 | 
			
		||||
          //注:ws路径
 | 
			
		||||
          "path": "/PATH/"
 | 
			
		||||
        },
 | 
			
		||||
        "network": "ws",
 | 
			
		||||
        "security": "tls"
 | 
			
		||||
      },
 | 
			
		||||
      "tag": "proxy"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "blackhole",
 | 
			
		||||
      "settings": {},
 | 
			
		||||
      "tag": "blocked"
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "freedom",
 | 
			
		||||
      "settings": {},
 | 
			
		||||
      "tag": "dicert"
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
  "routing": {
 | 
			
		||||
    //注:全域名规则匹配
 | 
			
		||||
    "domainStrategy": "AsIs",
 | 
			
		||||
    "rules": [
 | 
			
		||||
      {
 | 
			
		||||
        "type": "field",
 | 
			
		||||
        "domain": [
 | 
			
		||||
          //注:填写对应域名和host
 | 
			
		||||
          "domain:domain.Name"
 | 
			
		||||
        ],
 | 
			
		||||
        "outboundTag": "dicert"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "type": "field",
 | 
			
		||||
        "inboundTag": [
 | 
			
		||||
          "socks-in",
 | 
			
		||||
          "http-in"
 | 
			
		||||
        ],
 | 
			
		||||
        "outboundTag": "proxy"
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
  "other": {}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										84
									
								
								Websocket+Nginx+TLS/config_server.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								Websocket+Nginx+TLS/config_server.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
{
 | 
			
		||||
  "log": {
 | 
			
		||||
    "access": "/var/log/v2ray/access.log", 
 | 
			
		||||
    "error": "/var/log/v2ray/error.log", 
 | 
			
		||||
    //可能取值 "debug" "info" "warning" "error" 其中"debug"记录的数据最多,"error"记录的最少 "none"表示不记录任何内容 默认值为"warning"
 | 
			
		||||
    "loglevel": "debug" 
 | 
			
		||||
  },
 | 
			
		||||
  //注"policy"字段需要core≥3.1
 | 
			
		||||
  "policy": {
 | 
			
		||||
    "levels": {
 | 
			
		||||
      "0": {
 | 
			
		||||
        "uplinkOnly": 0,
 | 
			
		||||
        "downlinkOnly": 0,
 | 
			
		||||
        "connIdle": 150,
 | 
			
		||||
        "handshake": 4
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "inbound": {
 | 
			
		||||
    //默认值为"0.0.0.0"
 | 
			
		||||
    "listen": "127.0.0.1", 
 | 
			
		||||
    "port": 10086, 
 | 
			
		||||
    "protocol": "vmess", 
 | 
			
		||||
    "settings": {
 | 
			
		||||
      "clients": [
 | 
			
		||||
        {
 | 
			
		||||
          "id": "7f43b638-dc47-11e7-9296-cec278b6b50a",
 | 
			
		||||
          //"level"字段与"policy"字段中的"levels"字段中的对应,默认值:0,注:需要core≥3.1
 | 
			
		||||
          "level": 0, 
 | 
			
		||||
          "alterId": 64
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    }, 
 | 
			
		||||
    "streamSettings": {
 | 
			
		||||
      "network": "ws", 
 | 
			
		||||
      "security": "auto", 
 | 
			
		||||
      "wsSettings": {
 | 
			
		||||
        "path": "/PATH/", 
 | 
			
		||||
        "headers": {
 | 
			
		||||
          "Host": "domain.Name"
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }, 
 | 
			
		||||
  "outbound": {
 | 
			
		||||
    "protocol": "freedom", 
 | 
			
		||||
    "settings": { }
 | 
			
		||||
  }, 
 | 
			
		||||
  "outboundDetour": [
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "blackhole", 
 | 
			
		||||
      "settings": { }, 
 | 
			
		||||
      "tag": "blocked"
 | 
			
		||||
    }
 | 
			
		||||
  ], 
 | 
			
		||||
  "routing": {
 | 
			
		||||
    "strategy": "rules", 
 | 
			
		||||
    "settings": {
 | 
			
		||||
      "rules": [
 | 
			
		||||
        {
 | 
			
		||||
          "type": "field", 
 | 
			
		||||
          "ip": [
 | 
			
		||||
            "0.0.0.0/8", 
 | 
			
		||||
            "10.0.0.0/8", 
 | 
			
		||||
            "100.64.0.0/10", 
 | 
			
		||||
            "127.0.0.0/8", 
 | 
			
		||||
            "169.254.0.0/16", 
 | 
			
		||||
            "172.16.0.0/12", 
 | 
			
		||||
            "192.0.0.0/24", 
 | 
			
		||||
            "192.0.2.0/24", 
 | 
			
		||||
            "192.168.0.0/16", 
 | 
			
		||||
            "198.18.0.0/15", 
 | 
			
		||||
            "198.51.100.0/24", 
 | 
			
		||||
            "203.0.113.0/24", 
 | 
			
		||||
            "::1/128", 
 | 
			
		||||
            "fc00::/7", 
 | 
			
		||||
            "fe80::/10"
 | 
			
		||||
          ], 
 | 
			
		||||
          "outboundTag": "blocked"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										54
									
								
								Websocket+Nginx+TLS/config_server_ver4.2.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								Websocket+Nginx+TLS/config_server_ver4.2.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
{
 | 
			
		||||
  "log": {
 | 
			
		||||
    "loglevel": "debug"
 | 
			
		||||
  }, 
 | 
			
		||||
  "inbounds": [
 | 
			
		||||
    {
 | 
			
		||||
      "port": 10086, 
 | 
			
		||||
      "listen": "127.0.0.1", 
 | 
			
		||||
      "tag": "vmess-in", 
 | 
			
		||||
      "protocol": "vmess", 
 | 
			
		||||
      "settings": {
 | 
			
		||||
        "clients": [
 | 
			
		||||
          {
 | 
			
		||||
	//注:UUID
 | 
			
		||||
            "id": "UUID", 
 | 
			
		||||
            "alterId": 64
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      }, 
 | 
			
		||||
      "streamSettings": {
 | 
			
		||||
        "network": "ws", 
 | 
			
		||||
        "wsSettings": {
 | 
			
		||||
	//注:ws路径
 | 
			
		||||
          "path": "/PATH/", 
 | 
			
		||||
          "headers": { }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ], 
 | 
			
		||||
  "outbounds": [
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "freedom", 
 | 
			
		||||
      "settings": { }, 
 | 
			
		||||
      "tag": "direct"
 | 
			
		||||
    }, 
 | 
			
		||||
    {
 | 
			
		||||
      "protocol": "blackhole", 
 | 
			
		||||
      "settings": { }, 
 | 
			
		||||
      "tag": "blocked"
 | 
			
		||||
    }
 | 
			
		||||
  ], 
 | 
			
		||||
  "routing": {
 | 
			
		||||
    "domainStrategy": "AsIs", 
 | 
			
		||||
    "rules": [
 | 
			
		||||
      {
 | 
			
		||||
        "type": "field", 
 | 
			
		||||
        "inboundTag": [
 | 
			
		||||
          "vmess-in"
 | 
			
		||||
        ], 
 | 
			
		||||
        "outboundTag": "direct"
 | 
			
		||||
      }
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										131
									
								
								Websocket+Nginx+TLS/nginx_Domain.Name.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										131
									
								
								Websocket+Nginx+TLS/nginx_Domain.Name.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,131 @@
 | 
			
		||||
##
 | 
			
		||||
# You should look at the following URL's in order to grasp a solid understanding
 | 
			
		||||
# of Nginx configuration files in order to fully unleash the power of Nginx.
 | 
			
		||||
# https://www.nginx.com/resources/wiki/start/
 | 
			
		||||
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
 | 
			
		||||
# https://wiki.debian.org/Nginx/DirectoryStructure
 | 
			
		||||
#
 | 
			
		||||
# In most cases, administrators will remove this file from sites-enabled/ and
 | 
			
		||||
# leave it as reference inside of sites-available where it will continue to be
 | 
			
		||||
# updated by the nginx packaging team.
 | 
			
		||||
#
 | 
			
		||||
# This file will automatically load configuration files provided by other
 | 
			
		||||
# applications, such as Drupal or Wordpress. These applications will be made
 | 
			
		||||
# available underneath a path with that package name, such as /drupal8.
 | 
			
		||||
#
 | 
			
		||||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
 | 
			
		||||
##
 | 
			
		||||
 | 
			
		||||
# Default server configuration
 | 
			
		||||
#
 | 
			
		||||
#####本配置使用正常环境 debian9_x64 nginx_1.10.3 openssl_1.1.0f v2ray_4.2
 | 
			
		||||
#####兼容客户端Firefox 27, Chrome 30, IE 11 on Windows 7, Edge, Opera 17, Safari 9, Android 5.0, and Java 8
 | 
			
		||||
#####注:切勿修改<nginx.conf>中的内容,但<该文件>与<nginx.conf>中的<参数重叠>那么会<遵从前者>
 | 
			
		||||
 | 
			
		||||
server {
 | 
			
		||||
	# 禁用不需要的请求方式 以下只允许 get、post
 | 
			
		||||
        if ($request_method  !~ ^(POST|GET)$) {
 | 
			
		||||
                return	444;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
	listen		127.0.0.1:80;
 | 
			
		||||
	server_name	domain.Name;	#注:填写自己的域名
 | 
			
		||||
	return		301 https://$host/;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
upstream v2ray {
 | 
			
		||||
        server		127.0.0.1:10086;	#注:v2ray后端监听地址、端口
 | 
			
		||||
        keepalive	2176;   # 链接池空闲链接数
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
map $http_upgrade $connection_upgrade {
 | 
			
		||||
        default		upgrade;
 | 
			
		||||
        ''		close;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
server {
 | 
			
		||||
	#要开启 HTTP/2 注意nginx版本 
 | 
			
		||||
	#可以使用 nginx -V 检查
 | 
			
		||||
	listen	127.0.0.1:443 ssl http2 backlog=1024 so_keepalive=120s:60s:10 reuseport;	# backlog是nginx 监听队列 默认是511 使用命令 ss -tnl查看(Send-Q);
 | 
			
		||||
	#设置编码
 | 
			
		||||
	charset         utf-8;
 | 
			
		||||
 | 
			
		||||
	#证书配置
 | 
			
		||||
	ssl_certificate		PATH;	#注:填写自己证书路径
 | 
			
		||||
	ssl_certificate_key	PATH;	#注:填写密钥路径
 | 
			
		||||
 | 
			
		||||
	ssl_session_cache	shared:SSL:50m;
 | 
			
		||||
	ssl_session_timeout	1d;
 | 
			
		||||
	ssl_session_tickets	off;
 | 
			
		||||
	
 | 
			
		||||
	# https://nginx.org/en/docs/http/ngx_http_ssl_module.html
 | 
			
		||||
	ssl_protocols	TLSv1.2;
 | 
			
		||||
	#openssl ciphers
 | 
			
		||||
	#注:懒人配置	https://mozilla.github.io/server-side-tls/ssl-config-generator/
 | 
			
		||||
	ssl_ciphers	'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
 | 
			
		||||
	ssl_prefer_server_ciphers on;
 | 
			
		||||
	
 | 
			
		||||
	#安全设定
 | 
			
		||||
	#屏蔽请求类型
 | 
			
		||||
        if ($request_method  !~ ^(POST|GET)$) {
 | 
			
		||||
                return  444;
 | 
			
		||||
        }
 | 
			
		||||
	add_header      X-Frame-Options         DENY;
 | 
			
		||||
	add_header      X-XSS-Protection        "1; mode=block";
 | 
			
		||||
	add_header      X-Content-Type-Options  nosniff;
 | 
			
		||||
	# HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
 | 
			
		||||
	###测试前请使用较少的时间
 | 
			
		||||
	### https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/
 | 
			
		||||
	add_header	Strict-Transport-Security max-age=15 always;
 | 
			
		||||
	
 | 
			
		||||
	#openssl dhparam -out dhparam.pem 2048
 | 
			
		||||
	#openssl dhparam -out dhparam.pem 4096
 | 
			
		||||
	#ssl_dhparam		/home/dhparam.pem;
 | 
			
		||||
	#ssl_ecdh_curve		secp384r1;
 | 
			
		||||
 | 
			
		||||
	# OCSP Stapling ---
 | 
			
		||||
	# fetch OCSP records from URL in ssl_certificate and cache them
 | 
			
		||||
	#ssl_stapling		on;
 | 
			
		||||
	#ssl_stapling_verify	on;
 | 
			
		||||
	#resolver_timeout	10s;
 | 
			
		||||
	#resolver	[去掉括号并将文字改成你希望的dns服务器ip地址]	valid=300s;
 | 
			
		||||
			#范例 resolver	2.2.2.2		valid=300s;
 | 
			
		||||
	
 | 
			
		||||
	root	/var/www/html;
 | 
			
		||||
 | 
			
		||||
	# Add index.php to the list if you are using PHP
 | 
			
		||||
	index index.html index.htm  index.php ;
 | 
			
		||||
 | 
			
		||||
	server_name	domain.Name;	#注: 将domain.Name 替换成你的域名
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	location /GLMzpX/ {	#注:修改路径
 | 
			
		||||
		proxy_http_version	1.1;
 | 
			
		||||
		proxy_set_header	Upgrade $http_upgrade;
 | 
			
		||||
		proxy_set_header	Connection $connection_upgrade;	#此处与<map>对应
 | 
			
		||||
		proxy_set_header	Host $http_host;
 | 
			
		||||
		
 | 
			
		||||
		# 向后端传递访客ip
 | 
			
		||||
                proxy_set_header X-Real-IP $remote_addr;
 | 
			
		||||
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 | 
			
		||||
		
 | 
			
		||||
		
 | 
			
		||||
		sendfile                on;
 | 
			
		||||
		tcp_nopush              on;
 | 
			
		||||
		tcp_nodelay             on;
 | 
			
		||||
		keepalive_requests      25600;
 | 
			
		||||
		keepalive_timeout	300 300;
 | 
			
		||||
		proxy_buffering         off;
 | 
			
		||||
		proxy_buffer_size       8k;
 | 
			
		||||
		
 | 
			
		||||
		#后端错误重定向
 | 
			
		||||
		proxy_intercept_errors on;
 | 
			
		||||
                error_page 400 = URL;		# url是一个网站地址。例如:https://www.xxxx.com/
 | 
			
		||||
		if ($http_host = "domain.Name" ) {	#注: 修改 domain.Name 为自己的域名
 | 
			
		||||
			#v2ray 后端 查看上面"upstream"字段
 | 
			
		||||
			proxy_pass      http://v2ray;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user