diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-18 06:50:32 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-01-18 06:50:32 +0100 |
commit | 9b8d43420000432a84522f071e3572a8887041f0 (patch) | |
tree | 205652838b59f0412d6082ff8dc260d8c3b189e3 | |
parent | Fix blog module. (diff) | |
download | website_blog_2-9b8d43420000432a84522f071e3572a8887041f0.tar.gz website_blog_2-9b8d43420000432a84522f071e3572a8887041f0.tar.xz |
blog module set up caching.
Diffstat (limited to '')
-rw-r--r-- | manifests/instance.pp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/manifests/instance.pp b/manifests/instance.pp index 07db874..8f9f1d1 100644 --- a/manifests/instance.pp +++ b/manifests/instance.pp @@ -71,13 +71,27 @@ define blog::instance ( } nginx::resource::location { "${safe_title} - /": - location => '/', - try_files => ['$uri', '$uri/', '=404'], - index_files => [], - ssl => true, - ssl_only => true, - autoindex => on, - server => $blog::blog_server_name, + location => '/', + try_files => ['$uri', '$uri/', '=404'], + index_files => [], + ssl => true, + ssl_only => true, + autoindex => on, + server => $blog::blog_server_name, + add_header => { + 'Cache-Control' => "no-cache", + }, + } + + nginx::resource::location { "${safe_title} - css": + location => '~ \.css$', + try_files => [ '$uri', '=404' ], + ssl => true, + ssl_only => true, + expires => '1h', + add_header => { + 'Cache-Control' => "no-cache", + }, } nginx::resource::location { "${safe_title} - php": |