Hi
I am trying to set a cache proxy to s3, and was following examples I have found on the web - I am retrieving the file but the cacheing is not being done. I have enabled debug but I am not sure what is going inside
here is my config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
#error_log /var/log/nginx/error.log debug;
# Make site accessible from http://localhost/
server_name localhost;
location ~* ^/public_proxy/(.*) {
set $s3_bucket 'alon-test.s3-us-west-2.amazonaws.com';
set $url_full '$1';
proxy_http_version 1.1;
proxy_set_header Host $s3_bucket;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_buffering off;
proxy_intercept_errors on;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
proxy_cache s3cache;
proxy_cache_valid any 60m;
proxy_pass http://$s3_bucket/$url_full;
}
I am calling:
wget http://localhost/public_proxy/higayon.pdf
Thanks
Alon
I am trying to set a cache proxy to s3, and was following examples I have found on the web - I am retrieving the file but the cacheing is not being done. I have enabled debug but I am not sure what is going inside
here is my config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
#error_log /var/log/nginx/error.log debug;
# Make site accessible from http://localhost/
server_name localhost;
location ~* ^/public_proxy/(.*) {
set $s3_bucket 'alon-test.s3-us-west-2.amazonaws.com';
set $url_full '$1';
proxy_http_version 1.1;
proxy_set_header Host $s3_bucket;
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_buffering off;
proxy_intercept_errors on;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";
proxy_cache s3cache;
proxy_cache_valid any 60m;
proxy_pass http://$s3_bucket/$url_full;
}
I am calling:
wget http://localhost/public_proxy/higayon.pdf
Thanks
Alon