Header cache control for CDN

lifeisjustabout nginx-forum at nginx.us
Fri Feb 25 14:23:59 MSK 2011


hi i try to setup akamai cdn i upload all my pictures to CDN server and
all pictures point out from my website to CDN everything allright but
they let me put upto 3 days ttl time of images, when i go
www.webpagetest.org the site always warning that because is not 30days
the address something like
http://www.cdntechnologies.com/adsa.34a/mypicture.png  i want this
picture expire time to be 30days one of my friend told me can't override
because you dont hold images others says you can but dont know how to do
my conf something like 


     if ($myrewrite = "AB")
          {
                rewrite /(.+)(style|lightbox)\.css$ /$2.css last;
                rewrite /(.*)(userdata|install|addon|cron\/)(.*)$ /$2$3
last;
                rewrite /(.*)(js\/)(.*)$ /$2$3$4 last;
                rewrite ^/(.*)(index\.php)(\/?)(.*)$
/index.php?page=index/$4 last;
                rewrite /(.*)(images\/)(.*)(\.)(gif|jpe?g|png|ico)$
/$2$3$4$5 last;
                rewrite ^/(.*)$ /index.php?page=$1 last;

          }


       location ~ /\.ht { deny all;  }
         location ~ /(userdata|images)/ {
            gzip on;
            gzip_min_length 512;
            gzip_types application/xml text/css application/x-javascript
text/javascript;
            gzip_proxied any;
            gzip_http_version 1.0;
            root        $home_dir/www/;
            access_log  off;
            expires     30d;
        }


thanks in advance

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,178341,178341#msg-178341




More information about the nginx mailing list