Welcome! Log In Create A New Profile

Advanced

Re: How do I show 403 error

Maxim Dounin
March 04, 2015 08:48AM
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/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How do I show 403 error

blason March 03, 2015 11:07PM

Re: How do I show 403 error

Maxim Dounin March 04, 2015 08:48AM

Re: How do I show 403 error

blason March 04, 2015 10:16PM

Re: How do I show 403 error

Maxim Dounin March 05, 2015 07:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready