Linux / UNIX Tech Support Forum
This is a discussion on nginx Block Images in wp-uploads within the Web servers forums, part of the Mastering Servers category; Hi all..I am using nginx for my personal wordpress blog..I wanted to know how to restrict a file type in ...
Register free or login to your account to remove all advertisements.
|
|||||||
| Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues. |
![]() |
|
|
Thread Tools | Display Modes |
|
||||
|
This may be of assistance to you. I have used it once before:
Secure File Upload Check List With PHP - Hungred Dot Com Have a look: HTH, Jaysunn |
|
||||
|
Quote:
Thank you.. is there any other way ? I had used .htaccess to restrict a file type in apache ..but I dont know how to get this in done in nginx |
|
||||
|
Take a look at location directive. It can be used to match given regex and take some action. For example, following be used to block hotlinking:
Code:
location ~* (\.jpg|\.png|\.gif)$ {
valid_referers blocked theos.in www.theos.in;
if ($invalid_referer) ) {
return 444;
}
}
Code:
location /path/to/your/wp-uploads {
if ($request_uri ~* (^\/|\.jpg|\.png|\.gif)$ ) {
break;
}
return 444;
}
__________________
Vivek Gite Last edited by nixcraft; 19th November 2009 at 11:10 AM. |
| The Following User Says Thank You to nixcraft For This Useful Post: | ||
vamsi (19th November 2009) | ||
|
||||
|
Quote:
![]() thanks |
|
||||
|
how fast is nginx? some one said lighttpd is very fast, thoughts?
I think only large size website need nginx or lighttpd server. Most small site are okay with apache. At least most of our customer run apache.
__________________
Raj Linux rulz. I have never turned back in my life ; I shall not do so today.. haha |
|
||||
|
Quote:
|
|
|||
|
Hello Guys,
I want to know more about lsof command, however I have basic info of that command which is not sufficient to trace out many things. As lsof is great tool. |
![]() |
|
|
| Tags |
| nginx, nginx location, nginx restirct file types |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux Automatically mount NFS and ISO Images on Boot | san | CentOS / RHEL / Fedora | 1 | 28th December 2008 08:01 PM |
| How to block ultrasurf | mail.mohanasundaram | Networking, Firewalls and Security | 0 | 16th August 2008 12:15 PM |
| Verify Fedora 7 ISO images to get rid of burn error problem | deonitin | Getting started tutorials | 2 | 26th July 2007 04:41 PM |
| Secure vsftpd FTP permissions on anonymous user uploads | nixcraft | Getting started tutorials | 6 | 20th December 2006 02:00 AM |
| How can I add custom watermarks to images from shell prompt? | ac1 | Linux software | 2 | 20th December 2005 10:53 PM |