Centos7安装caddy 、xui
# 安装
docker pull caddy
docker run -it \
--name caddy \
--network=host \
--cap-add NET_ADMIN \
-v $(pwd)/Caddyfile:/etc/caddy/Caddyfile \
-v $(pwd)/site:/srv \
caddy
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
vi Caddyfile
:80 {
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
h5.ai.yanchun.com {
reverse_proxy 127.0.0.1:180 {
# 设置请求头(请求头设置要使用 header_up)
header_up Host {host}
header_up X-Forwarded-For {remote}
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 二、安装x-ui
docker run -itd --network=host -v $PWD/db/:/etc/x-ui/ -v $PWD/cert/:/root/cert/ --name x-ui --restart=unless-stopped enwaiax/x-ui
1
默认账号密码 admin/admin
上次更新: 2025/03/06, 14:32:07