Project

General

Profile

[Solved] Maximum size of $HTTP["host"]?

Added by azilber about 8 years ago

Hey All,

I've been adding tons of domain name fragments to the HTTP["host"] field. 
I'm at a point where I'm getting a nervous that I may reach a limit and have lighty just silently stop routing domains.
Does anyone know the limit of the string I can put in there? Currently, the full string size is 501 characters.
When should I split this up into separate directives, or is it safe to just keep adding domains to it?

Thanks!
Alex


Replies (1)

RE: Maximum size of $HTTP["host"]? - Added by gstrauss about 8 years ago

I don't think that lighttpd specifies an arbitrary limit, though I would recommend staying under 64kB.

Also, I suggest that you do a simple test by filling the beginning and middle with lots of arbitrary, made-up domain name fragments and then put a valid one at or near the end of the (very) long config line. Start up lighttpd with that config and make sure it works. I expect it will. Still, I want to encourage you to quantify and validate your configs using empirical data. :)

You may want to look at some of the larger vhost modules if you are hosting a large number of domains, e.g. one of
- mod_simple_vhost
- mod_evhost
- mod_mysql_vhost

    (1-1/1)