Fixed handling of multiple puma endpoints and of wildcard IP addresses

Improved the handling of multiple upstream endpoints and of app servers configured to use "0.0.0.0" as IP address.