-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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文件路径 | ||
} | ||
} | ||
} |