Troubleshooting Varnish/HAProxy/Nginx

Given there are 3 reverse proxies, if one is causing an issue, finding the cause can sometimes be difficult.

Testing Nginx

This can be tested by overwriting the IP address for the domain in your hosts file to be 172.16.0.71 (regardless of the domain name)

This will put the traffic directly to Nginx on the web1 node

Testing HAProxy

This can be tested by overwriting the IP address for the domain in your hosts file to be 172.16.0.41 (regardless of the domain name). Then access the URL on port 81.

Eg. https://www.example.com:81/test.php

This will force the query through HAProxy on the load balancer.

Testing Varnish

Finally, Varnish is the last stage to be tested. Simply remove any entries from your hosts file and access the site as normal. Varnish error messages usually have Varnish cache server in the footer.

There is also a specific header set when traffic is passed through Varnish, MageStack-Cache. Either two values are set, hit or miss.

  • hit is when the content has been served from the Varnish cache
  • miss is when the content has been served directly from the backend, bypassing the cache

! This is for HTTP ONLY, not HTTPS