Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
rewrite /downloads(.*) /noindex_downloads$1 last; >>>> } >>>> } >>>> location /noindex_downloads/ { >>>> internal; >>>> root /downloads/; >>>> } >>>> >>>> >&

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
gt; } >>> >>> and then in in the download location block >>> >>> autoindex $allowed; >>> >>> I use similar logic on different variables and try at all costs to avoid >>> IF statements anywhere in the configs. >

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Igor A. Ippolitov
*Date: *Friday, May 18, 2018 at 2:16 AM *To: *"nginx@nginx.org" <mailto:nginx@nginx.org> <nginx@nginx.org> <mailto:nginx@nginx.org> *Subject: *Re: Nginx Directory Listing - Restrict by IP Address Hi Satish, There are "

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Francis Daly
On Fri, May 18, 2018 at 08:05:34AM +0800, Sathish Kumar wrote: Hi there, > We have a requirement to allow directory listing from few servers and > disallow from other ip addresses and all IP addresses should be able to > download all files inside the directory. "Directory listings" is

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
o avoid >> IF statements anywhere in the configs. >> >> >> >> ___ >> >> Michael Friscia >> >> Office of Communications >> >> Yale School of Medicine >> >> (203) 737-7

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Igor A. Ippolitov
t; <mailto:nginx@nginx.org> <nginx@nginx.org> <mailto:nginx@nginx.org> *Date: *Friday, May 18, 2018 at 2:16 AM *To: *"nginx@nginx.org" <mailto:nginx@nginx.org> <nginx@nginx.org> <mailto:nginx@nginx.org> *Subject: *Re: Nginx Directory Listing

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Anoop Alias
> >> ___ >> >> Michael Friscia >> >> Office of Communications >> >> Yale School of Medicine >> >> (203) 737-7932 - office >> >> (203) 931-5381 - mobile >> >> http://web.yale.edu >> >&

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
; <nginx-boun...@nginx.org> on > behalf of PRAJITH <prajithpalakk...@gmail.com> > <prajithpalakk...@gmail.com> > *Reply-To: *"nginx@nginx.org" <nginx@nginx.org> <nginx@nginx.org> > <nginx@nginx.org> > *Date: *Friday, May 18, 2018 at

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
f Medicine > > (203) 737-7932 - office > > (203) 931-5381 - mobile > > http://web.yale.edu > > > > *From: *nginx <nginx-boun...@nginx.org> on behalf of PRAJITH < > prajithpalakk...@gmail.com> > *Reply-To: *"nginx@nginx.org" <n

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Igor A. Ippolitov
<nginx-boun...@nginx.org> on behalf of PRAJITH <prajithpalakk...@gmail.com> *Reply-To: *"nginx@nginx.org" <nginx@nginx.org> *Date: *Friday, May 18, 2018 at 2:16 AM *To: *"nginx@nginx.org" <nginx@nginx.org> *Subject: *Re: Nginx Dir

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Friscia, Michael
f of PRAJITH <prajithpalakk...@gmail.com> Reply-To: "nginx@nginx.org" <nginx@nginx.org> Date: Friday, May 18, 2018 at 2:16 AM To: "nginx@nginx.org" <nginx@nginx.org> Subject: Re: Nginx Directory Listing - Restrict by IP Address Hi Satish, There are "if" co

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread Sathish Kumar
Hi Prajith, I had tried this option but autoindex is not allowed under if statement. location / { root /downloads; if ($allowed = 1) { autoindex on; } } Error: "autoindex" directive is not allowed here in domain.conf Thanks & Regards Sathish.V On Fri, May 18, 2018 at 2:16 PM

Re: Nginx Directory Listing - Restrict by IP Address

2018-05-18 Thread PRAJITH
Hi Satish, There are "if" constructs in nginx, please check http://nginx.org/r/if. if you want to allow multiple IP addresses, it might be better idea to use map. eg: map $remote_addr $allowed { default 0; 1.1.1.1 1; 2.2.2.2 1; } and then in in the download

Nginx Directory Listing - Restrict by IP Address

2018-05-17 Thread Sathish Kumar
Hi Team, We have a requirement to allow directory listing from few servers and disallow from other ip addresses and all IP addresses should be able to download all files inside the directory. Can somebody provide the correct nginx config for the same. location / { root /downloads; autoindex on;