3 messages in ru.sysoev.nginxImage hotlinking rewrite
FromSent OnAttachments
Jan ŚlusarczykJun 14, 2007 1:53 am 
Igor SysoevJun 14, 2007 2:04 am 
Jan ŚlusarczykJun 14, 2007 9:20 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Image hotlinking rewriteActions...
From:Jan Ślusarczyk (jan.@public.gmane.org)
Date:Jun 14, 2007 1:53:17 am
List:ru.sysoev.nginx

Hi,

I'm using nginx to serve static files and proxy the dynamic requests to apache in the backend. It works very good and allowed me to free a lot of memory. Now | need to fight bandwidth staling on one of our servers and I can't solve the problem on my own.

This is the vhost config:

server { listen x.x.x.x:80; server_name www.servername.com www.otherservername.com; access_log /var/log/nginx/www.servername.com.access.log combined; # vbulletin attachment rewrites location ~* ^.+.(attachments|customavatars|archive) { proxy_pass http://apache; include /etc/nginx/proxy.conf; } location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|rar|bz2|doc|xls| exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ { root /var/www/hosts/www.servername.com; expires 1d; } location / { proxy_pass http://apache; include /etc/nginx/proxy.conf; } }

I need to redirect requests for images from specific hosts (I will compile the names every couple of days manually) to a specific file (ie. do_not_steal_bandwidth.gif). Can you help me with this?