I have 2 multi-tenant FusionPBX's and they now both get an Nginx 504 timeout when creating domains. If the page is reloaded (not refreshed), it loads and pops up the green domain added bar at the top of the screen.
The only simple fix is to upgrade to latest master branch.
Mark very recently changed the behavior for domain creation in master branch. On 4.4 and older (a few weeks) master branches, the code was running "app defaults" on all existing domains plus the new domain causing the web server to timeout. Now it only updates the new domain to avoid the time out scenario.
If upgrading isn't feasible at the moment, you could probably change some nginx settings but I'm not sure what those would be.