My unified push setup for matrix notifications broke earlier this year. Turns out in the meantime it also broke in 3 more ways. I've now managed to simplify my setup by using https://github.com/UnifiedPush/common-proxies and allowing synapse to resolve the IP of the gateway.