Request Timeout error 504

Openfire version: 4.2.3
Session is getting dropped in seconds after it is created on server.
Seeing Request timeout (504) error code in console with CORS error.

What can be the cause for this?