mirror of
https://github.com/v2fly/v2ray-examples.git
synced 2025-04-21 09:49:30 +08:00
Vless 自动回落到 Caddy2
This commit is contained in:
parent
5ac8a6f16d
commit
f8095d13a8
7
VLESS-TCP-Caddy2/Caddyfile
Normal file
7
VLESS-TCP-Caddy2/Caddyfile
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
https_port 4433
|
||||
auto_https disable_redirects
|
||||
}
|
||||
http://example.com, https://example.com
|
||||
root * /var/www/html
|
||||
file_server
|
16
VLESS-TCP-Caddy2/README.md
Normal file
16
VLESS-TCP-Caddy2/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Vless 自动回落到 Caddy2
|
||||
|
||||
## 准备
|
||||
|
||||
你需要有一个解析到服务器 IP 的域名,替换文档中的 example.com
|
||||
Vless 将使用 Caddy 申请的证书,无需额外配置
|
||||
将你的自建网站放置于 /var/www/html 路径
|
||||
|
||||
## Caddy2 安装
|
||||
|
||||
[https://caddyserver.com/docs/download#debian-ubuntu-raspbian]()
|
||||
|
||||
## v2ray 读取证书失败
|
||||
|
||||
修改证书 key 文件的权限为 644
|
||||
[https://github.com/v2fly/fhs-install-v2ray/wiki/Insufficient-permissions-when-using-certificates-zh-Hans-CN]()
|
39
VLESS-TCP-Caddy2/config_client.json
Normal file
39
VLESS-TCP-Caddy2/config_client.json
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 1080,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"udp": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "example.com", // 换成你的域名
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "", // 填写你的 UUID
|
||||
"encryption": "none",
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
44
VLESS-TCP-Caddy2/config_server.json
Normal file
44
VLESS-TCP-Caddy2/config_server.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 443,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "" // 填写你的 UUID
|
||||
}
|
||||
],
|
||||
"decryption": "none",
|
||||
"fallbacks": [
|
||||
{
|
||||
"dest": 80
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.crt", // example.com 换成你的域名
|
||||
"keyFile": "/caddy/certificates/acme-v02.api.letsencrypt.org-directory/example.com/example.com.key" // example.com 换成你的域名
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user