<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Nginx Proxy Returns Odd Results</title>
        <description> 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

-- 
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
&amp;#110;&amp;#103;&amp;#105;&amp;#110;&amp;#120;&amp;#64;&amp;#110;&amp;#103;&amp;#105;&amp;#110;&amp;#120;&amp;#46;&amp;#111;&amp;#114;&amp;#103;
http://mailman.nginx.org/mailman/listinfo/nginx</description>
        <link>http://www.serverphorums.com/read.php?5,500475,500475#msg-500475</link>
        <lastBuildDate>Tue, 18 Jun 2013 07:45:00 +0200</lastBuildDate>
        <generator>Phorum 5.2.18</generator>
        <item>
            <guid>http://www.serverphorums.com/read.php?5,500475,501485#msg-501485</guid>
            <title>Re: Nginx Proxy Returns Odd Results</title>
            <link>http://www.serverphorums.com/read.php?5,500475,501485#msg-501485</link>
            <description><![CDATA[ Hello!<br />
<br />
On Tue, May 22, 2012 at 06:59:01PM +0100, Jonathan Matthews wrote:<br />
<br />
&gt; On 22 May 2012 12:18, Maxim Dounin &lt;mdounin@mdounin.ru&gt; wrote:<br />
&gt; &gt; The problem is that you are removing request arguments in &quot;location<br />
&gt; &gt; ~ /ws/(.*)&quot;.  Use this instead:<br />
&gt; &gt;<br />
&gt; &gt;    location /ws/ {<br />
&gt; &gt;        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
&gt; &gt;    }<br />
&gt; &gt;<br />
&gt; &gt;    location / {<br />
&gt; &gt;        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
&gt; &gt;    }<br />
&gt; <br />
&gt; Are those proxy_pass trailing slashes correct?<br />
<br />
Yes (you may omit one in &quot;location /&quot;, but it doesn't really <br />
matter).<br />
<br />
&gt; Don't they remove the path so that the upstream sees all requests on<br />
&gt; the root URI?<br />
<br />
See <a href="http://nginx.org/r/proxy_pass" target="_blank"  rel="nofollow">http://nginx.org/r/proxy_pass</a>:<br />
<br />
    When passing a request to the server, part of a URI matching <br />
    the location is replaced by a URI specified in the proxy_pass <br />
    directive.<br />
<br />
Note well: this doesn't apply if you specify proxy_pass URL using <br />
variables.  In this special case the URI passed is expected to be <br />
fully specified in proxy_pass, and this is what actually causes <br />
original problem as it's specified without arguments.<br />
<br />
Maxim Dounin<br />
<br />
_______________________________________________<br />
nginx mailing list<br />
<a href="mailto:&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;">&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;</a><br />
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank"  rel="nofollow">http://mailman.nginx.org/mailman/listinfo/nginx</a>]]></description>
            <dc:creator>Maxim Dounin</dc:creator>
            <category>Nginx</category>
            <pubDate>Wed, 23 May 2012 10:00:05 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?5,500475,501052#msg-501052</guid>
            <title>Re: Nginx Proxy Returns Odd Results</title>
            <link>http://www.serverphorums.com/read.php?5,500475,501052#msg-501052</link>
            <description><![CDATA[ On 22 May 2012 12:18, Maxim Dounin &lt;mdounin@mdounin.ru&gt; wrote:<br />
&gt; The problem is that you are removing request arguments in &quot;location<br />
&gt; ~ /ws/(.*)&quot;.  Use this instead:<br />
&gt;<br />
&gt;    location /ws/ {<br />
&gt;        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
&gt;    }<br />
&gt;<br />
&gt;    location / {<br />
&gt;        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
&gt;    }<br />
<br />
Are those proxy_pass trailing slashes correct?<br />
Don't they remove the path so that the upstream sees all requests on<br />
the root URI?<br />
<br />
-- <br />
Jonathan Matthews<br />
Oxford, London, UK<br />
<a href="http://www.jpluscplusm.com/contact.html" target="_blank"  rel="nofollow">http://www.jpluscplusm.com/contact.html</a><br />
<br />
_______________________________________________<br />
nginx mailing list<br />
<a href="mailto:&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;">&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;</a><br />
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank"  rel="nofollow">http://mailman.nginx.org/mailman/listinfo/nginx</a>]]></description>
            <dc:creator>Jonathan Matthews</dc:creator>
            <category>Nginx</category>
            <pubDate>Tue, 22 May 2012 20:00:01 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?5,500475,500754#msg-500754</guid>
            <title>Re: Nginx Proxy Returns Odd Results</title>
            <link>http://www.serverphorums.com/read.php?5,500475,500754#msg-500754</link>
            <description><![CDATA[ Hello!<br />
<br />
On Tue, May 22, 2012 at 03:24:36AM +0200, Dan King wrote:<br />
<br />
&gt; Hi,<br />
&gt; <br />
&gt; I'm trying to configure nginx as a proxy essentially imitating this<br />
&gt; apache server (http://pastebin.com/1Tv4usjf).<br />
&gt; <br />
&gt; The configuration I've put together (http://pastebin.com/MtsvJ9Cb)<br />
&gt; produces odd results. For example if I use travel to:<br />
&gt; <br />
&gt; <a href="http://127.0.0.1/ws/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail" target="_blank"  rel="nofollow">http://127.0.0.1/ws/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail</a><br />
&gt; <br />
&gt; I'm supposed to get a thumbnail, but instead I get a full sized image.<br />
&gt; If I bypass the nginx proxy (or use the apache proxy):<br />
&gt; <br />
&gt; <a href="http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail" target="_blank"  rel="nofollow">http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail</a><br />
&gt; <br />
&gt; I get the correctly sized image.<br />
&gt; <br />
&gt; Does anyone know how can I see/log what nginx is forwarding? Does anyone<br />
&gt; know from the config files what the problem could be?<br />
<br />
The problem is that you are removing request arguments in &quot;location <br />
~ /ws/(.*)&quot;.  Use this instead:<br />
<br />
    location /ws/ {<br />
        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
    }<br />
<br />
    location / {<br />
        proxy_pass <a href="http://127.0.0.1:8080/" target="_blank"  rel="nofollow">http://127.0.0.1:8080/</a>;<br />
    }<br />
<br />
Maxim Dounin<br />
<br />
_______________________________________________<br />
nginx mailing list<br />
<a href="mailto:&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;">&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;</a><br />
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank"  rel="nofollow">http://mailman.nginx.org/mailman/listinfo/nginx</a>]]></description>
            <dc:creator>Maxim Dounin</dc:creator>
            <category>Nginx</category>
            <pubDate>Tue, 22 May 2012 13:20:02 +0200</pubDate>
        </item>
        <item>
            <guid>http://www.serverphorums.com/read.php?5,500475,500475#msg-500475</guid>
            <title>Nginx Proxy Returns Odd Results</title>
            <link>http://www.serverphorums.com/read.php?5,500475,500475#msg-500475</link>
            <description><![CDATA[ Hi,<br />
<br />
I'm trying to configure nginx as a proxy essentially imitating this<br />
apache server (http://pastebin.com/1Tv4usjf).<br />
<br />
The configuration I've put together (http://pastebin.com/MtsvJ9Cb)<br />
produces odd results. For example if I use travel to:<br />
<br />
<a href="http://127.0.0.1/ws/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail" target="_blank"  rel="nofollow">http://127.0.0.1/ws/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail</a><br />
<br />
I'm supposed to get a thumbnail, but instead I get a full sized image.<br />
If I bypass the nginx proxy (or use the apache proxy):<br />
<br />
<a href="http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail" target="_blank"  rel="nofollow">http://127.0.0.1:8080/profiles/ff808181352a536901352a6fb6950000/requests/ff80818135fefa7e0135ff03de3a0000/images/ff80818135fefa7e0135ff03e20c0001?type=thumbnail</a><br />
<br />
I get the correctly sized image.<br />
<br />
Does anyone know how can I see/log what nginx is forwarding? Does anyone<br />
know from the config files what the problem could be?<br />
<br />
Thanks,<br />
-Dan<br />
<br />
-- <br />
Posted via <a href="http://www.ruby-forum.com/" target="_blank"  rel="nofollow">http://www.ruby-forum.com/</a>.<br />
<br />
_______________________________________________<br />
nginx mailing list<br />
<a href="mailto:&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;">&#110;&#103;&#105;&#110;&#120;&#64;&#110;&#103;&#105;&#110;&#120;&#46;&#111;&#114;&#103;</a><br />
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank"  rel="nofollow">http://mailman.nginx.org/mailman/listinfo/nginx</a>]]></description>
            <dc:creator>Dan King</dc:creator>
            <category>Nginx</category>
            <pubDate>Tue, 22 May 2012 03:30:02 +0200</pubDate>
        </item>
    </channel>
</rss>
