webm versionbs and nginx config

This commit is contained in:
Steffen Illium
2023-12-24 11:36:05 +01:00
committed by Steffen Illium
parent 15067ad5a2
commit b4f81145e0
97 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,9 @@
map $http_accept $webp_suffix { "~*webp" ".webp"; }
types {
# ensure the nginx supports the mime type
image/webp webp;
}
server {
listen 80;
listen [::]:80;
@ -10,6 +16,17 @@ server {
index index.html index.htm;
}
location ~* \.(js|css|jpg|jpeg|png|gif|js|css|ico|swf)$ {
expires 1y;
etag off;
if_modified_since off;
add_header Cache-Control "public, no-transform";
}
location ~* \.(?:ico|cur|gif|svg|svgz|png|jpe?g)(\?.+)?$ {
try_files $uri$webp_suffix $uri =404;
}
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;