Nginx Proxy Returns Odd Results

Hi,

I’m trying to configure nginx as a proxy essentially imitating this
apache server (http://pastebin.com/1Tv4usjf).

The configuration I’ve put together (http://pastebin.com/MtsvJ9Cb)
produces odd results. For example if I use travel to:

http://127.0.0.1/ws/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail

I’m supposed to get a thumbnail, but instead I get a full sized image.
If I bypass the nginx proxy (or use the apache proxy):

http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail

I get the correctly sized image.

Does anyone know how can I see/log what nginx is forwarding? Does anyone
know from the config files what the problem could be?

Thanks,
-Dan

Hello!

On Tue, May 22, 2012 at 03:24:36AM +0200, Dan K. wrote:

I’m supposed to get a thumbnail, but instead I get a full sized image.
If I bypass the nginx proxy (or use the apache proxy):

http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail

I get the correctly sized image.

Does anyone know how can I see/log what nginx is forwarding? Does anyone
know from the config files what the problem could be?

The problem is that you are removing request arguments in “location
~ /ws/(.*)”. Use this instead:

location /ws/ {
    proxy_pass http://127.0.0.1:8080/;
}

location / {
    proxy_pass http://127.0.0.1:8080/;
}

Maxim D.

On 22 May 2012 12:18, Maxim D. [email protected] wrote:

The problem is that you are removing request arguments in “location
~ /ws/(.*)”. Use this instead:

location /ws/ {
proxy_pass http://127.0.0.1:8080/;
}

location / {
proxy_pass http://127.0.0.1:8080/;
}

Are those proxy_pass trailing slashes correct?
Don’t they remove the path so that the upstream sees all requests on
the root URI?


Jonathan M.
Oxford, London, UK
http://www.jpluscplusm.com/contact.html

Hello!

On Tue, May 22, 2012 at 06:59:01PM +0100, Jonathan M. wrote:

}

Are those proxy_pass trailing slashes correct?

Yes (you may omit one in “location /”, but it doesn’t really
matter).

Don’t they remove the path so that the upstream sees all requests on
the root URI?

See Alphabetical index of directives

When passing a request to the server, part of a URI matching
the location is replaced by a URI specified in the proxy_pass
directive.

Note well: this doesn’t apply if you specify proxy_pass URL using
variables. In this special case the URI passed is expected to be
fully specified in proxy_pass, and this is what actually causes
original problem as it’s specified without arguments.

Maxim D.