Pergunta

I am experiencing intermittent issues when using the Pingdom monitoring tool to check the status of my website.

Every 10-15 minutes I get an alert to say that a 302 has been found. What I can't understand is - i'm not doing any 302 temporary redirects. I am, however, doing 301 redirects (in certain circumstances).

Could this be a false positive from Pingdom?

Also, I have a redirect in code that does this. Would not specifying the HTTP response code cause an issue here?

header('Location: http://www.ayrshireminis.com');
exit();

The Pingdom data:

Request 1
GET / HTTP/1.0
User-Agent: Pingdom.com_bot_version_1.4_(http://www.pingdom.com/)
Host: www.ayrshireminis.com

Received header
302 Found
Date: Tue, 24 Jul 2012 13:13:25 GMT
Server: Apache
Set-Cookie: prev_session_id=2a7001f5caa79bd36995953bf4853675; expires=Thu, 23-Aug-2012 13:13:25 GMT; path=/; domain=ayrshireminis.com
Location: http://www.ayrshireminis.com/
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Foi útil?

Solução

Looks to me like a cookie is being set on the response, then redirecting you to the same page. Because Pingdom uses a number of different monitoring sources, that cookie redirect behavior will cause a lot of problems. Then again, you may need it for actual website visitors.

Rather than monitor the root of the webpage, I would recommend creating a separate /status page just for Pingdom that:

  1. Doesn't set or use cookies
  2. Performs a cheap end-to-end health check of the application and backing services
  3. Returns a 200 response code only if everything checks out OK
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top