forked from StephenMiracle/frankenwp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
48 lines (39 loc) · 1.12 KB
/
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
{
{$CADDY_GLOBAL_OPTIONS}
frankenphp {
#worker /path/to/your/worker.php
{$FRANKENPHP_CONFIG}
}
servers {
trusted_proxies static private_ranges
trusted_proxies_strict
}
# https://caddyserver.com/docs/caddyfile/directives#sorting-algorithm
order php_server before file_server
order php before file_server
order wp_cache before rewrite
order request_header before wp_cache
}
{$CADDY_EXTRA_CONFIG}
## Need to set all hosts with port for the cloud.
# You may not have the hostname being called due to dynamic IPs and load balancers.
# Allowing all hosts on port 80 for health checks, local dev & cases where the hostname is unknown.
:80 {
@static {
file
path *.ico *.css *.js *.gif *.jpg *.jpeg *.png *.svg *.woff
}
root * /var/www/html/
encode br zstd gzip
wp_cache {
loc {$CACHE_LOC:/var/www/html/wp-content/cache}
cache_response_codes {$CACHE_RESPONSE_CODES:2XX,404,405}
ttl {$TTL:6000}
purge_path {$PURGE_PATH:/__cache/purge}
purge_key {$PURGE_KEY}
bypass_home {$BYPASS_HOME:false}
bypass_path_prefixes {$BYPASS_PATH_PREFIXES:/wp-admin,/wp-json}
}
{$CADDY_SERVER_EXTRA_DIRECTIVES}
php_server
}