504 Gateway Timeout - The server was acting as a gateway or proxy and did not receive a timely response from the upstream server
You can view your HTTP-server logs and see whether the requests are hitting your server.
If not, then some proxy between client and you is not patient enough to wait for your server's response or experiences network problems.
If yes, then probably your application server (Tomcat, Ruby, Node.js, ...) is stalling the request or is not reachable.
And it would be interesting whether the 504 is returned intermittendly (often or rare) or your customer cannot reach your web resources at all. If this is a big problem for your customers, you should install some kind of End-to-End monitor.
BTW if the traffic is HTTP and not HTTPS, you can sniff it on different points in the network. On Solaris you can use snoop
, and on other Linux/*nix OSs tcpdump
or wireshark
. Wireshark comes with a very nice GUI and you can view the dumps you made with tcpdump on another machine.