Browse Source

* webp config from offline imageresponsive moved separate file in includes.d

master
parent
commit
be1385a4a5
  1. 13
      config/nginx/includes.d/octobercms.conf
  2. 8
      config/nginx/includes.d/offline-webp.conf
  3. 1
      config/nginx/includes.d/staticfiles.conf

13
config/nginx/includes.d/octobercms.conf

@ -15,11 +15,11 @@
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 /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 /storage/temp/public { try_files $uri /404; }
location ~ ^/modules/.*/assets { try_files $uri /404; }
location ~ ^/modules/.*/resources { try_files $uri /404; }
@ -43,9 +43,4 @@
location ~ ^/plugins/.*/.*/widgets/.*/assets { try_files $uri /404; }
location ~ ^/plugins/.*/.*/widgets/.*/resources { try_files $uri /404; }
location ~ ^/themes/.*/assets {
try_files $uri /404;
access_log off;
expires max;
}
location ~ ^/themes/.*/resources { try_files $uri /404; }

8
config/nginx/includes.d/offline-webp.conf

@ -0,0 +1,8 @@
location ~* \.(jpe?g|png)$ {
# @see https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/#responsive-images
add_header Vary Accept;
try_files $uri$webp_suffix @router;
}
location @router {
rewrite ^(.*)$ /plugins/offline/responsiveimages/webp.php?path=$uri;
}

1
config/nginx/includes.d/staticfiles.conf

@ -22,6 +22,7 @@ location = /empty {
empty_gif;
}
location ~* \.(eot|ttf|woff|pdf|css|js)$ {
try_files $uri /404;
access_log off;
expires max;
}

Loading…
Cancel
Save