Preserve IP host name in HTTP requests
This is a configuration change proposal for httpd configuration.
Using IP address in HTTP requests now produce a redirect to the first (default) vhost name. This is a problem if this name is not resolved by DNS (i.e. outside LAN).
UseCanonicalName directive is now set to
On in httpd.conf, that means a request to
<IPaddress>/something is redirected to
If set to
Off the IP address is preserved, as any other DNS name pointing to the web server. The request is served by the first (default) vhost configured.
#5 Updated by Davide Principi about 6 years ago
- Status changed from ON_DEV to MODIFIED
- Assignee deleted (
- % Done changed from 30 to 60
- Create a shared folder:
- Check redirect occurs on the requested host (In the following example: machine hostname
smtp.vboxnet0.tldas self alias, IP address
# curl -s -vL http://smtp.vboxnet0.tld/iba1 [...] < HTTP/1.1 301 Moved Permanently < Location: http://smtp.vboxnet0.tld/iba1/ [...] < HTTP/1.1 200 OK # curl -s -vL http://192.168.8.2/iba1 [...] < HTTP/1.1 301 Moved Permanently < Location: http://192.168.8.2/iba1/ [...] < HTTP/1.1 200 OK