You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Moshe Kaplan <mo...@gmail.com> on 2011/03/29 16:06:41 UTC

Last version 2.1.8-unstable Loops?

Hi,

I installed the 2.1.8-unstable version on a new AWS image.
After configuring the remap.config (no plugin yet), I get following endless
loop of 301 to the same URL (Chrome provides the following message: The
webpage at http://ec2-50-17-143-39.compute-1.amazonaws.com/ has resulted in
too many redirects).. Are you familiar with any known issue?

Best,
Moshe


   1. Request URL:
   http://ec2-50-17-143-39.compute-1.amazonaws.com/
   2. Request Method:
   GET
   3. Status Code:
   301 Moved Permanently
   4. Request Headers
      1. Accept:

      application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
      2. Accept-Charset:
      ISO-8859-1,utf-8;q=0.7,*;q=0.3
      3. Accept-Encoding:
      gzip,deflate,sdch
      4. Accept-Language:
      en-US,en;q=0.8
      5. Cache-Control:
      no-cache
      6. Connection:
      keep-alive
      7. Cookie:
      adinfo=65
      8. Host:
      ec2-50-17-143-39.compute-1.amazonaws.com
      9. Pragma:
      no-cache
      10. User-Agent:
      Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.16
      (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16
      5. Response Headers
      1. Age:
      6
      2. Connection:
      keep-alive
      3. Content-Length:
      0
      4. Date:
      Tue, 29 Mar 2011 14:01:15 GMT
      5. Location:
      http://ec2-50-17-143-39.compute-1.amazonaws.com/
      6. Server:
      ATS/2.1.8-unstable
      7. X-Powered-By:
      ASP.NET
      8. redirector:
      kredirector.19j10.1
      9. set-cookie:
      adinfo=65;path=/
      10. site:
      65

Re: Last version 2.1.8-unstable Loops?

Posted by Billy Vierra <bv...@netdna.com>.
I can confirm this is the issue, had the exact same issue when writing 
up some articles and this fixed it :)

On 03/29/2011 09:04 AM, Leif Hedstrom wrote:
> On 03/29/2011 09:26 AM, Moshe Kaplan wrote:
>> Hi Leif,
>>
>> Wired
>>
>> 1. I removed trailing slashes (I should not be the reason since it 
>> worked
>> for me on an incubator version)
>
> Ahh, I think I know why, you have pristine host headers enabled (it's 
> in records.config). This makes the Host: header be 
> ec2-50-17-143-39.compute-1.amazonaws.com, which google then interprets 
> as you doing something crazy, and they redirect you to www.google.com. 
> That is then rewritten by your reverse_map rule back to your machine 
> again, and therefore the loop.
>
> Just change the pristine host header setting to 0, and see if that 
> doesn't help.
>
> -- Leif
>

-- 
Billy Vierra
Senior System Engineer
NetDNA™
The Science of Acceleration™

Email: bvierra@netdna.com
P: 1.877.5-NETDNA (563-8362) ext 260
F: 1.323.417.4995

Follow Us
Web: http://www.NetDNA.com
Blog: http://blog.netdna.com
Twitter @NetDNACDN


Re: Last version 2.1.8-unstable Loops?

Posted by Leif Hedstrom <zw...@apache.org>.
On 03/29/2011 09:26 AM, Moshe Kaplan wrote:
> Hi Leif,
>
> Wired
>
>     1. I removed trailing slashes (I should not be the reason since it worked
>     for me on an incubator version)

Ahh, I think I know why, you have pristine host headers enabled (it's in 
records.config). This makes the Host: header be 
ec2-50-17-143-39.compute-1.amazonaws.com, which google then interprets 
as you doing something crazy, and they redirect you to www.google.com. 
That is then rewritten by your reverse_map rule back to your machine 
again, and therefore the loop.

Just change the pristine host header setting to 0, and see if that 
doesn't help.

-- Leif


Re: Last version 2.1.8-unstable Loops?

Posted by Moshe Kaplan <mo...@gmail.com>.
Hi Leif,

Wired

   1. I removed trailing slashes (I should not be the reason since it worked
   for me on an incubator version)
   2. I compiled the 2.1.7 to verify, and I got the same behavior
   3. Please find the results attached:

10x
Moshe

+++++++++ Incoming Request +++++++++
-- State Machine Id: 18
GET http://www.google.com/ HTTP/1.1
Host: ec2-50-17-143-39.compute-1.amazonaws.com
Connection: keep-alive
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: adinfo=65

+++++++++ Proxy's Request +++++++++
-- State Machine Id: 18
GET / HTTP/1.1
Host: ec2-50-17-143-39.compute-1.amazonaws.com
Cache-Control: max-age=0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16
Accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: adinfo=65
Client-ip: 79.182.201.113
X-Forwarded-For: 79.182.201.113
Via: http/1.1 domU-12-31-39-16-D1-1D[0A60D2EB]
(ApacheTrafficServer/2.1.7-unstable [uScMs f p eN:t cCMi p s ])

+++++++++ Incoming O.S. Response +++++++++
-- State Machine Id: 18
*HTTP/1.1 302 Found*
Location: http://www.google.com/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Tue, 29 Mar 2011 15:17:14 GMT
Server: sffe
Content-Length: 219
X-XSS-Protection: 1; mode=block

[Mar 29 15:17:14.857] Server {3079075648} DEBUG: (http_hdrs)
[initialize_state_variables_from_response]Server is keep-alive.
+++++++++ Base Header for Building Response +++++++++
-- State Machine Id: 18
HTTP/1.1 302 Found
Location: http://www.google.com/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Tue, 29 Mar 2011 15:17:14 GMT
Server: sffe
Content-Length: 219
X-XSS-Protection: 1; mode=block

+++++++++ Proxy's Response 2 +++++++++
-- State Machine Id: 18
HTTP/1.1 302 Found
Location: http://ec2-50-17-143-39.compute-1.amazonaws.com/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Tue, 29 Mar 2011 15:17:14 GMT
Server: ATS/2.1.7-unstable
Content-Length: 219
X-XSS-Protection: 1; mode=block
Age: 0
Connection: keep-alive


On Tue, Mar 29, 2011 at 4:39 PM, Leif Hedstrom <zw...@apache.org> wrote:

> On 03/29/2011 08:31 AM, Moshe Kaplan wrote:
>
>> Hi Leif,
>>
>> 10x for the quick answer
>>
>> The remap.config is pretty simple (no plugins yet, just compiled the
>> code):
>> map http://ec2-50-17-143-39.compute-1.amazonaws.com/
>> http://www.google.com/
>> reverse_map http://www.google.com/
>> http://ec2-50-17-143-39.compute-1.amazonaws.com/
>>
>
> Hmmm, I tried this, and I don't see your behaviour at all.
>
> What does Google return to you ? You could try not to anchor the mapping
> rules (remove the trailing slashes),  it seems to me that perhaps google is
> sending you a redirect response, that you then convert to your host again
> (that's what the reverse_map rule does).
>
> You'll have to take a look to see exactly what ATS sends to google, and
> what google sends back to you, and then what ATS sends back to the UA. You
> can try that, by running e.g.
>
>    % sudo traffic_server -T http_hdrs
>
> -- Leif
>

Re: Last version 2.1.8-unstable Loops?

Posted by Leif Hedstrom <zw...@apache.org>.
On 03/29/2011 08:31 AM, Moshe Kaplan wrote:
> Hi Leif,
>
> 10x for the quick answer
>
> The remap.config is pretty simple (no plugins yet, just compiled the 
> code):
> map http://ec2-50-17-143-39.compute-1.amazonaws.com/ 
> http://www.google.com/
> reverse_map http://www.google.com/ 
> http://ec2-50-17-143-39.compute-1.amazonaws.com/

Hmmm, I tried this, and I don't see your behaviour at all.

What does Google return to you ? You could try not to anchor the mapping 
rules (remove the trailing slashes),  it seems to me that perhaps google 
is sending you a redirect response, that you then convert to your host 
again (that's what the reverse_map rule does).

You'll have to take a look to see exactly what ATS sends to google, and 
what google sends back to you, and then what ATS sends back to the UA. 
You can try that, by running e.g.

     % sudo traffic_server -T http_hdrs

-- Leif


Re: Last version 2.1.8-unstable Loops?

Posted by Moshe Kaplan <mo...@gmail.com>.
Hi Leif,

10x for the quick answer

The remap.config is pretty simple (no plugins yet, just compiled the code):
map http://ec2-50-17-143-39.compute-1.amazonaws.com/ http://www.google.com/
reverse_map http://www.google.com/
http://ec2-50-17-143-39.compute-1.amazonaws.com/

The server response using Google Chrome Dev Tools is:
Request URL:http://ec2-50-17-143-39.compute-1.amazonaws.com/
Request Method:GET
Status Code:301 Moved Permanently
Request Headers
Accept:application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:adinfo=65
Host:ec2-50-17-143-39.compute-1.amazonaws.com
Pragma:no-cache
User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16
Response Headers
Age:6
Connection:keep-alive
Content-Length:0
Date:Tue, 29 Mar 2011 14:01:15 GMT
Location:http://ec2-50-17-143-39.compute-1.amazonaws.com/
Server:ATS/2.1.8-unstable
X-Powered-By:ASP.NET
redirector:kredirector.19j10.1
set-cookie:adinfo=65;path=/
site:65

10x,
Moshe

On Tue, Mar 29, 2011 at 4:21 PM, Leif Hedstrom <zw...@apache.org> wrote:

> On 03/29/2011 08:06 AM, Moshe Kaplan wrote:
>
>> Hi,
>>
>> I installed the 2.1.8-unstable version on a new AWS image.
>> After configuring the remap.config (no plugin yet), I get following
>> endless
>> loop of 301 to the same URL (Chrome provides the following message: The
>> webpage at http://ec2-50-17-143-39.compute-1.amazonaws.com/ has resulted
>> in
>> too many redirects).. Are you familiar with any known issue?
>>
>
> Doesn't ring any bells, but please provide some more information, what are
> your remap configuration rules, what does the origin return, are you trying
> to follow the redirect in ATS (there are configs for that) etc.
>
> Looking at the response, it's most certainly sending a Location: header
> back to itself, so it's doing the right thing.
>
> -- Leif
>
>

Re: Last version 2.1.8-unstable Loops?

Posted by Leif Hedstrom <zw...@apache.org>.
On 03/29/2011 08:06 AM, Moshe Kaplan wrote:
> Hi,
>
> I installed the 2.1.8-unstable version on a new AWS image.
> After configuring the remap.config (no plugin yet), I get following endless
> loop of 301 to the same URL (Chrome provides the following message: The
> webpage at http://ec2-50-17-143-39.compute-1.amazonaws.com/ has resulted in
> too many redirects).. Are you familiar with any known issue?

Doesn't ring any bells, but please provide some more information, what 
are your remap configuration rules, what does the origin return, are you 
trying to follow the redirect in ATS (there are configs for that) etc.

Looking at the response, it's most certainly sending a Location: header 
back to itself, so it's doing the right thing.

-- Leif