Symfony\Component\HttpFoundation\Request::getHost
Returns the host name.
This method can read the client port from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Host" header must contain the client host name. If your reverse proxy uses a different header name than "X-Forwarded-Host", configure it via "setTrustedHeaderName()" with the "client-host" key.
Signature
public function getHost()
Returns
- string
Errors/Exceptions
-
UnexpectedValueException
- when the host name is invalid