HOSTING.CONFIG(5)
β¨ HOSTING.CONFIG(5) β¨
okay bestie, so this is hosting.config β the Traffic Server domain hosting configuration file, and it is literally the file that decides which cache volume gets which origin server's content π
The hosting.config file (by default it lives in /usr/local/etc/trafficserver/) lets you assign cache volumes to specific origin servers and/or domains, so you can manage cache space efficiently and restrict disk usage. For step-by-step instructions on partitioning the cache according to origin servers and/or domains, go read Partitioning the Cache. π
But wait β before you can assign cache volumes to specific origin servers and/or domains, you have to first partition your cache according to size and protocol in the volume.config file. No skipping steps, bestie, the vibes depend on it. π¦
And after you modify hosting.config, navigate to the Traffic Server bin directory and run traffic_ctl config reload to apply your changes. Don't forget this part, it's giving "wrote the config and nothing happened" energy and we are NOT doing that. π
π FORMAT π
Every single line in the hosting.config file has to be one of these two formats, no exceptions:
hostname=HOST volume=NUMBERS
domain=DOMAIN volume=NUMBERS
and here's the breakdown, bestie:
HOSTis the fully-qualified hostname of the origin server whose content you want to store on a particular volume (for example,www.myhost.com) πΈDOMAINis the domain whose content you want to store on a particular partition (for example,mydomain.com) πNUMBERSis a comma-separated list of the partitions where you want to store the content that belongs to the origin server or domain listed. Those partition numbers must be valid numbers listed in thevolume.configβ no making up numbers, that's not the vibe. π
Note: To allocate more than one partition to an origin server or domain, you have to enter the partitions in a comma-separated list on one line, like the example below shows. The hosting.config file cannot contain multiple entries for the same origin server or domain. One entry per bestie, periodt. π
π«Ά GENERIC PARTITION π«Ά
When you're configuring the hosting.config file, you must assign a generic volume to use for content that doesn't belong to any of the origin servers or domains listed. And if all volumes for a particular origin server become corrupt, Traffic Server will also use the generic volume to store content for that origin server. It's the fallback bestie, the ride-or-die, the one who shows up when everything else is in shambles. π
The generic volume must have this exact format:
hostname=* volume=NUMBERS
where NUMBERS is a comma-separated list of generic volumes. β
π EXAMPLES π
The following example configures Traffic Server to store content from the domain mydomain.com in volume 1 and content from www.myhost.com in volume 2. Traffic Server stores content from all other origin servers in volumes 3 and 4. Slay.
domain=mydomain.com volume=1
hostname=www.myhost.com volume=2
hostname=* volume=3,4
π COPYRIGHT π
2026, dev@trafficserver.apache.org
and that's the whole page, bestie!! π this was Apache Traffic Server 9.2, dated Feb 12, 2026, and you absolutely ate that config. go reload and watch it work, iykyk π§β¨
π¦ where this page comes from
- ubuntu noble: trafficserver 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms