Skip to content

Commit

Permalink
Update 3_Caddyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lxhao61 committed Jul 14, 2021
1 parent 02173d7 commit 8e740a7
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions v2ray(E+B+C+F+A)+caddy/3_Caddyfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
{
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支持
}
}
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,让网站看起来更真实。
redir https://{host}{uri} permanent #http自动跳转https,让网站看起来更真实。
}

:88 { #启用进程绑定后此端口失效,仅做标记作用。
bind unix//dev/shm/h1h2c.sock #启用进程绑定后执行进程监听,仅接收web回落。
@host {
host xx.yy #限定域名访问(禁止以ip方式访问网站),更改为自己的域名。
}
route @host {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" #启用HSTS
}
file_server {
root /var/www/html #更改为自己存放的web文件路径
}
}
bind unix//dev/shm/h1h2c.sock #启用进程绑定后执行进程监听,仅接收web回落。

@host {
host xx.yy #限定域名访问(禁止以ip方式访问网站),更改为自己的域名。
}
route @host {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" #启用HSTS
}
file_server {
root /var/www/html #更改为自己存放的web文件路径
}
}
}

0 comments on commit 8e740a7

Please sign in to comment.