Bug #351

Ports in Host header cause problem with conditonals

Added by Anonymous 1162 days ago. Updated 89 days ago.

Status:Invalid Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:core
Target version:-
Pending:

No

Resolution:

invalid

Patch available:


Description

  1. handish virtual hosting
  2. map all subdomains to a single document-root
    $HTTPhost =~ "\.example\.org$" {
    server.document-root = "/var/www/htdocs/example.org/pages/"
    }

Some HTTP clients (notably Media Player for Mac) always include the port number in the Host header, even if it is not specified in the URL. $HTTP'host' is set to the whole value of the Host header, port and all, causing the above configuration to not work properly when a port number is present in the Host header. My current solution is just to remove the $ from the pattern, and allow Lighttpd match the hostname anywhere in the string.

$HTTPhost =~ "\.example\.org" {
server.document-root = "/var/www/htdocs/example.org/pages/"
}

-- psyon

History

12/25/2005 12:32 AM - Anonymous

Better to just write a complete regex:

$HTTPhost =~ "^www\.domain\.com(:\d+)?$"

This will match whether or not the port is appended.

-- cliff

09/02/2008 12:50 AM - stbuehler

  • Status changed from New to Fixed
  • Resolution set to invalid

mentioned in the docs.

10/10/2008 06:51 PM - stbuehler

  • Status changed from Fixed to Invalid

Also available in: Atom PDF