+ webp example config

This commit is contained in:
2021-11-17 00:15:51 +03:00
parent b85b503015
commit 471b5c1502

View File

@ -11,8 +11,16 @@ map $http_host $root {
loc.wordpress /usr/share/nginx/html/someprojectwp;
}
# @see https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/#responsive-images
map $http_accept $webp_suffix {
default "";
"~*webp" ".webp";
}
server {
server_name loc.octobercms;
server_name
loc.octobercms
;
listen 80;
root $root;
#include global/auth.conf;
@ -27,6 +35,30 @@ server {
}
}
server {
server_name
loc.octobercmswebp
;
listen 80;
root $root;
include includes.d/octobercms.conf;
include includes.d/offline-webp.conf;
include includes.d/staticfiles.conf;
location = /index.php {
fastcgi_pass php74;
include fastcgi_params;
fastcgi_read_timeout 3000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location = /plugins/offline/responsiveimages/webp.php {
fastcgi_pass php74;
include fastcgi_params;
fastcgi_read_timeout 3000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
server {
server_name loc.wordpress;
listen 80;