+ webp octobercms support

This commit is contained in:
2021-11-16 21:35:03 +03:00
parent e6477518d2
commit cbb1d79584
6 changed files with 29 additions and 12 deletions

View File

@ -6,20 +6,20 @@
rewrite ^/.*$ /index.php last;
expires max;
}
# Whitelist
## Let October handle if static file not exists
location ~ ^/favicon\.ico { try_files $uri /index.php; }
location ~ ^/sitemap\.xml { try_files $uri /index.php; }
location ~ ^/robots\.txt { try_files $uri /index.php; }
location ~ ^/humans\.txt { try_files $uri /index.php; }
location = /favicon.ico { try_files $uri /index.php; }
location = /sitemap.xml { try_files $uri /index.php; }
location = /robots.txt { try_files $uri /index.php; }
location = /humans.txt { try_files $uri /index.php; }
## Let nginx return 404 if static file not exists
location ~ ^/storage/app/uploads/public { try_files $uri /404; }
location ~ ^/storage/app/media { try_files $uri /404; }
location ~ ^/storage/app/yml { try_files $uri /404; }
location ~ ^/files { try_files $uri /404; }
location ~ ^/storage/app/.*\.xls { try_files $uri /404; }
location ~ ^/storage/temp/public { try_files $uri /404; }
#location /storage/app/uploads/public { try_files $uri /404; }
#location /storage/app/media { try_files $uri /404; }
#location /storage/app/yml { try_files $uri /404; }
location /storage/app/resized { try_files $uri /404; }
#location /storage/temp/public { try_files $uri /404; }
location ~ ^/modules/.*/assets { try_files $uri /404; }
location ~ ^/modules/.*/resources { try_files $uri /404; }
@ -48,5 +48,4 @@
access_log off;
expires max;
}
location ~ ^/themes/.*/semantic { try_files $uri /404; }
location ~ ^/themes/.*/resources { try_files $uri /404; }

View File

@ -1,5 +1,17 @@
#rewrite "^(.*)\.(\d{10})\.(css|js)$" $1.$3 break;
location ~* \.(jpg|jpeg|gif|png|svg|ico)$ {
location ~* \.(gif|svg|ico)$ {
access_log off;
expires max;
log_not_found off;
error_page 404 = /empty;
}
location ~* \.jpge?g$ {
access_log off;
expires max;
log_not_found off;
error_page 404 = /empty;
}
location ~* \.png$ {
access_log off;
expires max;
log_not_found off;