# Caching/storing hostname mapping?

**URL:** <https://www.ruby-forum.com/t/caching-storing-hostname-mapping/204428>\
**Category:** NGINX\
**Created:** [March 11, 2011, 6:03pm UTC](https://www.ruby-forum.com/t/caching-storing-hostname-mapping/204428 "2011-03-11T18:03:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 11, 2011, 6:03pm UTC](https://www.ruby-forum.com/t/caching-storing-hostname-mapping/204428/1 "2011-03-11T18:03:20Z")

</div>

I have some nginx configs that sometimes host mutiple domains and some  
file requests are mapped to the disk using some language.

And example would be WordPress MultiSite. Where  
[blog1.example.com/files/file1.jpg](http://blog1.example.com/files/file1.jpg) makes to blogs.dir/1/file1.jpg and  
[someanotherblog3.example.com/files/file2.jpg](http://someanotherblog3.example.com/files/file2.jpg) maps to  
blogs.dir/45/file2.jpg

These could be rewritting by hand individually to allow nginx to  
naturally cache the file, rather than handing it over to WordPress (PHP)  
map and server back to nginx.

Is there a way I can programmatically build these?

Posted at Nginx Forum:

> **[Caching/storing hostname mapping?](https://forum.nginx.org/read.php?2,182305,182305#msg-182305)**
>
> I have some nginx configs that sometimes host mutiple domains and some file requests are mapped to the disk using some language. And example would be WordPress MultiSite. Where blog1.example.com/files/file1.jpg makes to blogs.dir/1/file1.jpg and...
