From 471b5c1502233a24b39c7f386d2c3624a7340e41 Mon Sep 17 00:00:00 2001 From: Alex Prokopenko Date: Wed, 17 Nov 2021 00:15:51 +0300 Subject: [PATCH] + webp example config --- config/nginx/conf.d/vhosts.conf.example | 34 ++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/config/nginx/conf.d/vhosts.conf.example b/config/nginx/conf.d/vhosts.conf.example index 503be98..0e16039 100644 --- a/config/nginx/conf.d/vhosts.conf.example +++ b/config/nginx/conf.d/vhosts.conf.example @@ -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;