Welcome! Log In Create A New Profile

Advanced

Re: Block countries - Nginx

Francis Daly
May 24, 2018 06:56PM
On Thu, May 24, 2018 at 09:57:24PM +0800, Sathish Kumar wrote:

Hi there,

> The client is already sending the X-Forwarded-For but when it received on
> server it has multiple ips, how we can filter only the 1st IP and pass it
> to geo ip module to block the IP based on Country.

Does http://nginx.org/en/docs/http/ngx_http_realip_module.html do what
you want?

Note: you will have to decide which part of X-Forwarded-For to trust,
since the client can write anything they want to in there. That is what
set_real_ip_from is for.

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Block countries - Nginx

Sathish Kumar May 20, 2018 11:52PM

Re: Block countries - Nginx

basti May 21, 2018 02:04AM

Re: Block countries - Nginx

Sathish Kumar May 21, 2018 09:38PM

Re: Block countries - Nginx

basti May 22, 2018 03:10AM

Re: Block countries - Nginx

Frank Liu May 22, 2018 04:46AM

Re: Block countries - Nginx

Sathish Kumar May 23, 2018 09:52PM

Re: Block countries - Nginx

Frank Liu May 23, 2018 11:28PM

Re: Block countries - Nginx

pbooth May 23, 2018 11:48PM

Re: Block countries - Nginx

Sathish Kumar May 24, 2018 09:58AM

Re: Block countries - Nginx

Francis Daly May 24, 2018 06:56PM

Re: Block countries - Nginx

pbooth May 25, 2018 01:06AM

Re: Block countries - Nginx

Aleksandar Lazic May 22, 2018 04:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready