How do I show 403 error

Maxim Dounin mdounin at mdounin.ru
Wed Mar 4 13:46:52 UTC 2015


Hello!

On Tue, Mar 03, 2015 at 11:07:16PM -0500, blason wrote:

> Hi Guys,
> 
> I just setup nginx reverse proxy for my webservers which has port 80/443
> opened from internet and have very restircted access on firewall to the
> destination servers again those to particular servers on port 80 and 443.
> 
> What I see in the logs is 
> "GET http://www.baidu.com/ HTTP/1.1" 200 626 "-" "Mozilla/4.0 (compatible;
> MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648;
> .NET CLR 3.5.21022)" "-"
> 
> I know people are trying to use my server as open proxy which is failing and
> even I am not able to browse the sites but I am not getting any error page
> on my browser and just see blank page that means server is accepting the
> request but unable to forward. 
> 
> Hence would like to know how do I throw error message in nginx so that those
> requests would not even accepted by my proxy.

Try something like this in your config:

    server {
        listen 80 default_server;
        return 403;
    }

See here for details:

http://nginx.org/en/docs/http/request_processing.html

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list