Is it possible with nginx?

Maxim Dounin mdounin at mdounin.ru
Mon Feb 16 00:46:01 MSK 2009


Hello!

On Sun, Feb 15, 2009 at 10:05:31PM +0100, Peter Vage wrote:

> I would like to delegate dedicated server for hosting static files for
> some of my websites. For example i have got domains web1.com, web2.com
> and web34.com on first server. On second server I have got domain
> files.com.
> 
> I would like to ask you if this possible that i make links on web 1,2,3
> which looks like:
> http://web1.com.files.com/path/image.jpg
> http://web2.com.files.com/path/path/file.zip
> http://web3.com.files.com/another-path/background.gif
> 
> browsers try to get files from this links but there aren't this files,
> so on second server there is script index.php which download files from
> right servers and create folders /web1.com/path/image.jpg ,
> /web2.com/path/path/file.zip etc and send to browser this files. When
> another browser want that files then there are just that files on
> files.com server.
> 
> I don't know how to setu nginx config on second server that
> http://web1.com.files.com/path/image.jpg
> was
> http://web1.com.files.com/web1.com/path/image.jpg
> 
> This kind of solution is used by Coral CDN
> http://wiki.coralcdn.org/wiki.php?n=Main.FAQ
> 
> Have you got any solution how to do this?
> Maybe have you got any other idea how to create backup and speed up web
> server at the same time?

http://wiki.codemongers.com/NginxHttpProxyModule#proxy_store

Just create appropriate server's for web1.com.files.com etc, and 
proxy_pass on 404 to the original server with proxy_store enabled.

Maxim Dounin





More information about the nginx mailing list