Skip to content

Instantly share code, notes, and snippets.

@ljay79
Forked from jrodriguez-ifuelinteractive/lbcheck.php
Last active August 22, 2016 14:07
Show Gist options
  • Save ljay79/145a31869ee0446f0e43a34e0f16a826 to your computer and use it in GitHub Desktop.
Save ljay79/145a31869ee0446f0e43a34e0f16a826 to your computer and use it in GitHub Desktop.
Magento load balancer health check script
<?php
include './app/Mage.php';
try {
Mage::app();
// echo gethostname();
echo $_SERVER["SERVER_ADDR"]; // local IP, for instances behind ELB
} Catch (Exception $e) {
header("HTTP/1.0 503 Service Unavailable");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment