gzip
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
map $http_accept $webp_suffix { "~*webp" ".webp" };
|
||||||
|
types {
|
||||||
|
image/webp webp;
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
@@ -14,6 +19,10 @@ server {
|
|||||||
add_header Cache-Control "public, no-transform";
|
add_header Cache-Control "public, no-transform";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:png|jpe?g)(\?.+)?$ {
|
||||||
|
try_files $uri$webp_suffix $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
location = /404.html {
|
location = /404.html {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
@@ -26,4 +35,9 @@ server {
|
|||||||
#location = /50x.html {
|
#location = /50x.html {
|
||||||
# root /usr/share/nginx/html;
|
# root /usr/share/nginx/html;
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user