The URL is checked
Before anything is sent upstream, the request is validated in PHP: the scheme has to be http or https and the address has to look like a real link. The resolver then checks the host against its own catalogue of supported services and refuses anything it does not handle. That is what keeps the service from being used as an open proxy.