-
Notifications
You must be signed in to change notification settings - Fork 407
/
3_naive_Caddyfile
63 lines (57 loc) · 1.71 KB
/
3_naive_Caddyfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
order forward_proxy before route
order reverse_proxy before forward_proxy
admin off
log { #注意:版本不小于v2.4.0才支持日志全局配置,否则各自配置。
output file /var/log/caddy/access.log
level ERROR
}
auto_https off #禁用自动https
servers unix//dev/shm/h1h2c.sock { #与下边监听进程对应
listener_wrappers {
proxy_protocol #开启PROXY protocol接收
}
protocol {
allow_h2c #开启h2c server支持
}
}
}
:80 { #http默认监听端口
redir https://{host}{uri} permanent #http自动跳转https,让网站看起来更真实。
}
:88 { #绑定进程后此端口失效,仅做标记作用。
bind unix//dev/shm/h1h2c.sock #http/1.1与h2c server监听进程
reverse_proxy /SeuW56Es 127.0.0.1:2005 { #与vless+h2c应用中path对应,转发给本机vless+h2c监听端口。
transport http {
versions h2c 2
}
}
@vgrpc { #匹配器标签。此标签仅区分,多个不同代理需要改成不同名称,但要与下边‘reverse_proxy’中匹配器标签对应。
path /VALdGZ9k/* #与vless+grpc应用中serviceName对应
protocol grpc
}
reverse_proxy @vgrpc 127.0.0.1:2009 { #转发给本机vless+grpc监听端口
transport http {
versions h2c 2
}
flush_interval -1
header_up X-Real-IP {remote_host}
}
forward_proxy {
basic_auth user pass #naiveproxy用户与密码,修改为自己的。
hide_ip
hide_via
probe_resistance
}
@host {
host xx.yy #限定域名访问(禁止以IP方式访问网站),修改为自己的域名。
}
route @host {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" #启用HSTS
}
file_server {
root /var/www/html #修改为自己存放的WEB文件路径
}
}
}