504 means you were able to talk to api.faforever.com but it wasn’t able to reach the backend service. So the fact that it started working again after you flushed your firewall rules is just a coincidence.
Just noting that in case someone finds this in the future and thinks that if they get a 504 error they can fix it by flushing firewall rules. You can’t. Just wait a bit and try again or notify the server admins.