# v2ray

## v2ray

### 安装

```
bash <(curl -L -s https://install.direct/go.sh)
​
statemctl enable v2ray
systemctl start v2ray
systemctl status v2ray
```

### &#x20;配置

`cat /etc/v2ray/config.json`

```
{
  "inbounds": [{
    "port": XXX,
    "listen": "127.0.0.1",
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "XXX",
          "alterId": 64
        }
      ]
    },
    "streamSettings": {
      "network": "ws",
      "wsSettings": {
        "path": "/XXX"
      }
    }
  }],
  "outbounds": [{
    "protocol": "freedom",
    "settings": {}
  }]
}
```

## 证书

```
yum -y install epel-release
yum -y install certbot
certbot certonly --standalone -d XXX
```

## nginx

### 安装

```
yum install -y nginx
systemctl enable nginx
systemctl start nginx
systemctl status nginx
```

### 配置

`cat /etc/nginx/conf.d/v2ray.conf`

```
server {
    listen       443 ssl;
    server_name  XXX;
​
    ssl_certificate    /etc/letsencrypt/live/XXX/fullchain.pem;
    ssl_certificate_key    /etc/letsencrypt/live/XXX/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;
​
location /tian {
    proxy_pass       http://127.0.0.1:XXX;
    proxy_redirect             off;
    proxy_http_version         1.1;
    proxy_set_header Upgrade   $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host      $http_host;
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yunzhao.gitbook.io/notes/other/v2ray.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
