0

I'm running a nginx server on debian 9 to save some bandwidth for my s3 bucket. It currently holds 300gb of data. In order to save some money I want to move this data to another server. I'm currently copying nginx cache files to new server but I think it will not work. Any ideas how to setup my servers config so that cached files won't hit s3 bucket? My current idea is to do something like this: [NEW Server] -> [Old server] -> S3. Here is my old server nginx config:

  proxy_cache            s3_cache;
  proxy_http_version     1.1;
  proxy_set_header       Connection "";
  proxy_set_header       Authorization '';
  proxy_set_header       Host static.xxxxxxxxxxx.com.s3-website-us-east-1.amazonaws.com;
  proxy_hide_header      x-amz-id-2;
  proxy_hide_header      x-amz-request-id;
  proxy_hide_header      x-amz-meta-server-side-encryption;
  proxy_hide_header      x-amz-server-side-encryption;
  proxy_hide_header      Set-Cookie;
  proxy_ignore_headers   Set-Cookie;
  proxy_cache_revalidate on;
  proxy_intercept_errors on;
  proxy_cache_use_stale  error timeout updating http_500 http_502 http_503 http_504;
  proxy_cache_lock       on;
  proxy_cache_valid      200 304 60m;
  add_header             Cache-Control max-age=31536000;
  add_header             X-Cache-Status $upstream_cache_status;
  proxy_pass             http://static.xxxxxxxxxxxxx.com.s3-website-us-east-1.amazonaws.com/;
Rob
  • 21
  • 4
  • Are these servers in the same AWS region as the S3 bucket? Are they in the same availability zone as each other? – Michael - sqlbot Mar 10 '20 at 16:00
  • these two servers have nothing to do with AWS. They just simply cache bucket content to reduce bandwidth cost. I need to move nginx cache contents from one machine to another and that's all. – Rob Mar 11 '20 at 18:19
  • If the servers are not inside AWS, then the motivation behind the question makes more sense, and that is why I asked -- if they were both inside AWS then copying the cache from one machine to another could easily cost more than simply refreshing the cache from S3 on demand, depending on topology... and in fact there would be no clear purpose for the cache, since bandwidth from EC2 to the Internet costs the same as bandwidth from S3 to the Internet. – Michael - sqlbot Mar 11 '20 at 20:17

0 Answers0