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