If you use a proxy server for your internet activity, and you are unable to fix a 504 error by refreshing the page or restarting the browser, you should check your browsers settings. The configuration could be defective and you should try to select a different proxy to work on.
Another solution to this problem would be restart all of your network devices. Temporary problems with your modem, router, switches, or other networking hardware could be causing the 504 Gateway Timeout issue you're seeing. Just restarting these devices could help.
If you're having the problem on multiple or all sites the problem might be a proxy you are using. Also using another DNS might help.
The answer to this problem is very simple. Firste, you could try to refresh the web browser. If the problem continues, try to connect with another network. If the problem persist, is better to wait to another moment in which less people are connected.