Nginx Proxy Returns Odd Results

Maxim Dounin mdounin at mdounin.ru
Tue May 22 11:18:39 UTC 2012


Hello!

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

> 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?

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 Dounin



More information about the nginx mailing list