Skip to content

Commit c3249a7

Browse files
committed
Update ghost nginx config to include assets and images caching
1 parent 936fb06 commit c3249a7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

nginx/conf/ghost.conf

+18
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,22 @@ server {
2222

2323
proxy_pass http://ghost:2368;
2424
}
25+
26+
# Cache Ghost Images
27+
location ~ "/assets/images/(.*)-([a-z0-9]{10})\.(?:png|jpe?g|tiff)(.*)$" {
28+
expires max;
29+
add_header Cache-Control public;
30+
add_header Vary Accept;
31+
proxy_pass http://ghost:2368/$uri$webp_suffix;
32+
access_log off;
33+
}
34+
35+
# Cache Ghost css and js
36+
location ~* \.(?:css|js) {
37+
expires max;
38+
add_header Cache-Control public;
39+
proxy_pass http://ghost:2368/$uri;
40+
access_log off;
41+
}
42+
2543
}

0 commit comments

Comments
 (0)