Welcome! Log In Create A New Profile

Advanced

Limit file types that can be proxied

May 27, 2010 02:19PM
I am trying to limit the file types that can be proxied from our backend server. I am trying to limit it to jpg, gif, png, css and then two other specific files - Thumbnail.ashx and hearbeat.htm. I am also hoping to limit access to only certain referers.

I have tried this code which works fine for the jpg, gif, png, css but is not working for the heartbeat.htm file. It gives a 404 on all .htm files including heartbeat.htm.

location ~* (\.jpg|\.png|\.gif|\.css|ThumbNail\.ashx|heartbeat\.htm)$ {

valid_referers
none
blocked
example.com
www.example.com
examplellimages.com
www.examplellimages.com
1.examplellimages.com
2.examplellimages.com
3.examplellimages.com
4.examplellimages.com;

if ($invalid_referer) {
return 404;
}



proxy_pass http://exampleimages_com;
}

Any help would be appreciated.
Subject Author Posted

Limit file types that can be proxied

reference123 May 27, 2010 02:19PM

Re: Limit file types that can be proxied

☣Merlin May 27, 2010 02:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready