According to http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers, the X-Forwarded-Host can contain more than one value:
Be careful when using these headers on the origin server, since they will contain more than one (comma-separated) value if the original request already contained one of these headers
Can REMOTE_HOST contain more than one value? Or it always be the single value?
That's true for
X-Forwarded-Host
just because there might be multiple proxies in between the original client and the server. TheREMOTE_HOST
is just a resolved name ofREMOTE_ADDR
, or NULL, if the resolution fails (i.e. noPTR
exists or DNS is temporarily unavailable or the query times out). It's always a single value.REMOTE_ADDR
is always a single value usually referring to the direct client connecting the server. However, with mod_remoteip you can alter this behaviour to get the originating useragent even where that useragent is behind a load balancer, front end server, or proxy server. That's useful when using load balancers and server side reverse proxies, whileX-Forwarded-Host
is suitable for client side proxies.