nginx changes the hostname of proxy_pass into ip address unwantedly nginx-forum at
Wed Dec 2 01:42:43 UTC 2015

I have configured nginx to use mod_zip to zip up multiple files.

I also have configured nginx so that it proxies to s3 when our server gets a
request to /images.

location /p/ {
When I access a file via < server >/images/foo.png, everything works great.

However, when I try using mod_zip, the
gets rewritten to an ip address

S3 needs the bucket-name in the url and gives me a NoSuchBucket error when I
try using the ip address

I get the following error

2015/12/01 01:37:08 [error] 14955#0: *16 mod_zip: a subrequest returned 400,
aborting... while reading response header from upstream, client:, server:, request: "GET /api/get_zipfile
HTTP/1.1", subrequest: "/p/foo.png", upstream: "http://", host: ""

Why is nginx or mod_zip rewriting the hostname portion of my s3 URL into an
ip address?

Posted at Nginx Forum:,263199,263199#msg-263199

More information about the nginx mailing list