简体   繁体   中英

proxy OR rewrite rule to serve static content via cloudfront in proxy server

I have apache reverse proxy server(under ELB) in front of apache servers. I want to serve images and uploads folder via statc.example.com Cname to cloudfront. I tried some proxypass and rewrite rule but not worked.

Please help me on this. Any help much appreciated.

I have fixed it, the below rule worked fine for me.

RewriteCond %{HTTP_HOST} ^test.example\.com$
RewriteCond %{HTTP_USER_AGENT} !^static.example\.com$
RewriteRule ^(.*)\.(png|js|jpg|gif|ico)$ http://static.example.com/$1.$2 [NE,R=302,L]

Hope it help someone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM