Add cookbook for static asset hosting
Configures assets.kosmos.org, only for webfont hosting for now.
This commit is contained in:
25
site-cookbooks/kosmos_assets/templates/nginx_conf_assets.erb
Normal file
25
site-cookbooks/kosmos_assets/templates/nginx_conf_assets.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<% if File.exist?(@ssl_cert) && File.exist?(@ssl_key) -%>
|
||||
# Generated by Chef
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name <%= @domain %>;
|
||||
|
||||
root /var/www/<%= @domain %>/site;
|
||||
|
||||
access_log off;
|
||||
gzip_static on;
|
||||
gzip_comp_level 5;
|
||||
|
||||
location ~* .(css)$ {
|
||||
expires 1d;
|
||||
}
|
||||
|
||||
location ~* .(woff|woff2)$ {
|
||||
expires max;
|
||||
}
|
||||
|
||||
ssl_certificate <%= @ssl_cert %>;
|
||||
ssl_certificate_key <%= @ssl_key %>;
|
||||
}
|
||||
<% end -%>
|
||||
Reference in New Issue
Block a user