-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCaddyfile
55 lines (43 loc) · 1.08 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
49
50
51
52
53
54
55
www.example.com {
redir https://example.com{uri}
}
example.com {
# Set this path to your site's directory.
root * /var/www/example.com/wordpress
# ssl cloudflare
# tls /etc/ssl/example.com.pem /etc/ssl/example.com.key
encode zstd gzip
@disallowed {
path /xmlrpc.php
path /wp-content/uploads/*.php
}
rewrite @disallowed /index.php
# Serve a PHP site through php-fpm
php_fastcgi unix//run/php/php7.4-fpm.sock
@static {
file
path *.css *.js *.ico *.woff *.woff2
}
handle @static {
header Cache-Control "public, max-age=31536000"
}
@static-img {
file
path *.gif *.jpg *.jpeg *.png *.svg *.webp *.avif
}
handle @static-img {
header Cache-Control "public, max-age=31536000, immutable"
}
# Enable the static file server.
file_server {
precompressed zstd gzip
index index.html
}
log {
output file /var/log/caddy/ssl_access.log {
roll_size 100mb
roll_keep 3
roll_keep_for 7d
}
}
}