Welcome! Log In Create A New Profile

Advanced

Re: How to use Nginx as a proxy for S3 compatible storage with version 4 signature?

Reinis Rozitis
December 14, 2016 08:56AM
> It would be easy to proxy requests like this:
> https://mydomain.com/<bucket>/<files>

> but with version4 we need to send requests like:
> https://<bucket>.mydomain.com/<my_files>

> The problem is that s3storage is a private node which hasn't a public domain. Only Nginx (which is a public node) can see s3storage.
> Does somebody know how to properly proxy such requests?

If you allready have a previous working configuration for the above setup then changing the hostname which nginx uses for the backend is kind of simple – you just need to pass a Host header which works for the S3 backend (by default nginx uses whatever is in the proxy_pass directive either IP or the name from upstream {} block).


It wasn’t exactly clear (to me) how the client interacts with nginx (which is the correct url) I mean if it sends the request using https://<bucket>.mydomain.com/<my_files> to nginx you can just use a simple config:


A generic example (optionally the backend can be defined in seperate upstream {} block):

server {
server_name <bucket>.mydomain.com;
location / {
proxy_set_header Host <bucket>.mydomain.com;
proxy_pass https://yours3backendhostname;
}
}



rr_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to use Nginx as a proxy for S3 compatible storage with version 4 signature?

Alexandr Porunov December 14, 2016 07:10AM

Re: How to use Nginx as a proxy for S3 compatible storage with version 4 signature?

Reinis Rozitis December 14, 2016 08:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready