Maxim Dounin
December 02, 2015 11:06AM

On Tue, Dec 01, 2015 at 08:42:43PM -0500, wrote:

> 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/ {
> proxy_pass;
> }
> 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?

Note that "upstream" as logged to error log shows an IP address of
a particular server used, not a host name used in the request.
This is intentional behaviour to make it easy to debug which
backend server caused an error.

To find out what was in fact sent in the Host request header
you'll have to look into debugging log (or use tcpdump to see what
is actually sent though the wire).

Maxim Dounin

nginx mailing list
Subject Author Posted

nginx changes the hostname of proxy_pass into ip address unwantedly December 01, 2015 08:42PM

Re: nginx changes the hostname of proxy_pass into ip address unwantedly

Maxim Dounin December 02, 2015 11:06AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 286
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