0
votes
1answer
16 views

How to deny requests in nginx when there is no referer?

In nginx access.log I see many lines like: 1.2.3.4 - - [19/Oct/2014:22:48:11 -0400] "POST /someurl/suburl HTTP/1.1" 200 19967 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) ...
1
vote
1answer
24 views

How to deny POST to a url in nginx

Some of the sql heavy urls on my app (say /members) are being attacked by botnets. So I'd like to disable anybody to post to these urls, while allowing others to GET them. I tried to make a nested ...
0
votes
1answer
32 views

Nginx deny IP's and setting custom 403 downloads a file?

I've attached my Nginx conf file for my default site which runs on Ubuntu. What I'm trying to achieve is the following: Main directory is /usr/share/nginx/www with the default file index.php ...
0
votes
0answers
86 views

Nginx not denying hidden files?

I have the following server block but it doesn't seem to deny hidden files in the root (i.e. files beginning with .) properly. server { listen 80; ## listen for ipv4; this line is default and ...
1
vote
1answer
332 views

nginx deny directory and files to be downloaded

gurus. I have a problem and i dont know how to solve it. I am working with Git and Compass/SASS on some projects. Now i want to protect those directories. When i go only to the folder its all fine – i ...
-1
votes
2answers
128 views

Nginx deny doesn't work for folder files

I'm trying to restrict access to my site to allow only specific IPs and I've got the following problem: when I access www.example.com deny works perfectly, but when I try to access ...
0
votes
3answers
2k views

nginx not blocking user agents

I have this in my .conf file for my website in attempt to block 2 user agents from constantly probing my server. ## Block http user agent - morpheus fucking scanner ## if ($http_user_agent ~* ...
1
vote
2answers
2k views

nginx deny user agent causes error when not encapsulated in quotes

I'm trying to deny some user agents I constantly see probing my nginx web server. If I have this in my .conf file ## Block http user agent - morpheus fucking scanner ## if ($http_user_agent ~* ...
0
votes
1answer
435 views

Reject Nginx request with no authentication in general

Is it possible to reject all nginx request, which don't send basic authentication data with them? I have requests like this: xxx.xxx.xxx.xxx - - [24/Oct/2012:10:32:12 +0200] "POST /path HTTP/1.1" ...
3
votes
1answer
620 views

Denying folder in Nginx causing PHP-FPM to not take precedence

The title says it all, but I have a very interesting problem that I am quite confused on. Basically, I have a simple WordPress installation, and I wish to deny a folder (along with all files in the ...
2
votes
1answer
366 views

Deny all gets overridden by another location block

location /_private { deny all; } location ~ \.php$ { # Workaround PHP vulnerability: # http://forum.nginx.org/read.php?2,88845,page=3 try_files $uri =404; include ...
1
vote
2answers
3k views

NGINX deny IP wildcard?

I currently deny IP addresses like this in the nginx.conf file: deny 42.22.11.531; But how would I deny deny 42.22.*.*; <---- this obviously doesnt work, what is the correct syntax for nginx? ...
10
votes
4answers
14k views

how to restrict access to directory and subdirs

I need to restrict access to any files or subdirs in direstory "testdir". My conf: ... location ~* ^.+\.(jpg|txt)$ { root /var/www/site; } location /testdir { deny all; ...