Welcome! Log In Create A New Profile

Advanced

deny in http {}, get 500 response , how to log this?

March 28, 2016 03:54AM
Hi All,

I'm using deny to deny some IPs for my server.

http {
deny 192.168.1.123; # this is an example


server {

error_page 403 /error/403.htm;
error_page 404 /error/404.htm;
error_page 502 /error/502.htm;
error_page 503 /error/503.htm;

location = /error/403.htm {
index 403.htm;
access_log /var/log/403.log main;
}

location ~* ^/(data|image)/.*.(php|php5)$ {
deny all;
}
}

I found that if 192.168.1.123 access my server, due to this ip is blocked in http {}, so it will get a 500 response.
And if someone (IP not blocked) try to access my data/*.php, he will get a 403 response.

And all these 500 and 403 response will be put into my 403.log.

Is it possible to put 500 response to a separate log? Then my 403 log will only log these who is trying to access the protected files.

I understand that if I put "deny IP" in to server {}, it will get a 403 response. But I want to deny some IPs on the whole server level.


Thanks
Subject Author Posted

deny in http {}, get 500 response , how to log this?

meteor8488 March 28, 2016 03:54AM

Re: deny in http {}, get 500 response , how to log this?

Maxim Dounin March 28, 2016 09:28AM

Re: deny in http {}, get 500 response , how to log this?

meteor8488 March 28, 2016 06:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 78
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