Saturday, 31 August 2013

Nginx : Proxy everything to s3 ( Error in configuration )?

Nginx : Proxy everything to s3 ( Error in configuration )?

I want to serve all my files from S3 except a few. Here is my config :
server_name website.com;
# DNS
resolver 8.8.8.8;
# Variables
set $s3 "https://s3.amazonaws.com/my_bucket";
location / {
proxy_pass $s3;
}
location ~* ^/others/*.php$ {
root /var/abc/
}
Now,
I am able to visit http://website.com/others/index.php [ OK ]
I have already applied s3 policy to allow GET Object. [ S3 Permission added ]
I am able to visit https://s3.amazonaws.com/my_bucket/file.jpg and see my
image. [ OK ]
But, getting 403 access-denied from http://website.com/file.jpg
What am I doing wrong ?

No comments:

Post a Comment