rewrite /downloads(.*) /noindex_downloads$1 last;
>>>> }
>>>> }
>>>> location /noindex_downloads/ {
>>>> internal;
>>>> root /downloads/;
>>>> }
>>>>
>>>>
>&
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.
>
*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 "
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
o avoid
>> IF statements anywhere in the configs.
>>
>>
>>
>> ___
>>
>> Michael Friscia
>>
>> Office of Communications
>>
>> Yale School of Medicine
>>
>> (203) 737-7
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
>
>> ___
>>
>> Michael Friscia
>>
>> Office of Communications
>>
>> Yale School of Medicine
>>
>> (203) 737-7932 - office
>>
>> (203) 931-5381 - mobile
>>
>> http://web.yale.edu
>>
>&
; <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
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
<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
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
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
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
13 matches
Mail list logo