adding headers for chaching

This commit is contained in:
Steffen Illium 2024-04-27 18:00:31 +02:00
parent c79161aa84
commit abe657a99d

View File

@ -3,8 +3,6 @@ server {
listen [::]:80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
@ -15,15 +13,15 @@ server {
root /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# Caching headers
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires 30d;
add_header Pragma public;
add_header Cache-Control "public";
}
gzip on;
gzip_comp_level 4;
gzip_types text/html text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
}
}