504 timeout error comes from LoadBalaner or proxy if the behind P360 Server is taking more time to provide response back to the request. An as per error stacktrace someone/something has aborted the socket connection in between (could be firewall or something at Network layer).
To isolate what is wrong, try internal URL of P360 web client -> If this works fine then investigate whats wrong in the architecture (Proxy/LB to firewall) causing this.
Even if direct web client is taking time then have to investigate on what operation is running and if there is any load on system.
- Lokesh Kumar