php - How can proxied image headers be modified on Apache? -


we proxy images licensed content , need add max-age headers proxied images. attempted modifying .htaccess, didn't work , suspect due proxied image folder not being actual directory on server.

first, proxy set in apache2.conf:

# image proxy proxypass /photo http://photo.licensor.com proxypassreverse /photo http://photo.licensor.com 

made several attempts modify .htaccess under site's public_html directory. appears condition modify max-age header proxied images never recognized apache since /photo not real directory.

i'd target proxied images using /photo directory isn't real.

you can't use <location> container in htaccess file. it's best put in apache server config file next proxypass settings:

<locationmatch "/photo">   # image proxy   proxypass http://photo.licensor.com   proxypassreverse http://photo.licensor.com   header unset etag    header set cache-control "max-age=86400, public"    header unset expires </locationmatch>