I have 2 servers one apache and one nginx.
I setup nginx as proxy
location / {
proxy_pass http://apachesample.com:8080/;
include /etc/nginx/conf.d/proxy.conf;
proxy_buffering off;
proxy_cache web-cache;
proxy_cache_valid 200 302 60m;
proxy_cache_valid 404 1m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
// try to add this section to add header and cache image
location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires max;
add_header Pragma public;
#add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
All images are not found when i try to add expries header ?
How can i set cache expires header for images ? Do i have to do it on apache server ?
FIXED: enable mod_rewrite