Leverage Browser Caching

hi i am running on nginx i use this rules


when i check the gmetrix or google page speed says Leverage browser caching erros

also cloudfront cd getting origins error

i think part of codes doesnt work

#   The main rule for searching static files
        location ~* /(\w+/)?(\w+/)?(.+\.(jpe?g|ico|gif|png|css|js|pdf|txt|tar|wof|woff|svg|ttf|csv|zip|xml|yml)) {
            access_log off;
        #   The rule for searching static files. If the server can’t find the file in the store folder, it will use the @statics rule.
        #   For example, if your store is located at example.com/shop/
            try_files $uri $uri/ /$1/$3 /$2/$3 $3 @statics;
            expires max;
            add_header Access-Control-Allow-Origin *;
            add_header Cache-Control public;

how can i fix this please help !

also i cant see curl -I image.png headers ?

In ‘/etc/nginx/sites-enabled/yoursite’ add or edit this code in the top:

server {
server_name yourdomain.xy;
server_name www.yourdomain.xy;
expires 35d;
client_max_body_size 4G;

Restart your server…

its worked but why up code doesnt work ? or who can fix it ? also update 4.7.2 ll thumbnails gone and never come back again

tried clear thumbnails cache. etc.