# Question about redirect?

**URL:** <https://www.ruby-forum.com/t/question-about-redirect/192009>\
**Category:** NGINX\
**Created:** [July 22, 2010, 12:08pm UTC](https://www.ruby-forum.com/t/question-about-redirect/192009 "2010-07-22T12:08:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Slask\_Sklask](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@Slask\_Sklask](https://www.ruby-forum.com/u/Slask_Sklask)\
**Post date:** [July 22, 2010, 12:08pm UTC](https://www.ruby-forum.com/t/question-about-redirect/192009/1 "2010-07-22T12:08:51Z")

</div>

Firstly I’m a newbie on both mailing lists AND nginx so please be nice  
to me  
😃

I use nginx as a reverse proxy and it works flawlessly.  
But now I want to put basic authentication on certain ip addresses.  
IE.

If I come from 10.0.0.0/24 network it should go through as usual.  
But if I come from 10.100.0.0/24 it should have basic authentication.  
Is there any way to accomplish this?

I use Apache as a backend webserver.

Br  
Patric

PS English is NOT my native language so sorry for any misspellings…

---

<div class="post-metadata">

**Author:** ![Slask\_Sklask](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@Slask\_Sklask](https://www.ruby-forum.com/u/Slask_Sklask)\
**Post date:** [July 23, 2010, 1:07am UTC](https://www.ruby-forum.com/t/question-about-redirect/192009/2 "2010-07-23T01:07:25Z")

</div>

I THINK you can define 2 server {} blocks and in each one define the IP  
as the server\_name or listen directive, it might work.

---

<div class="post-metadata">

**Author:** ![Slask\_Sklask](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/5f8ce5/32.png) [@Slask\_Sklask](https://www.ruby-forum.com/u/Slask_Sklask)\
**Post date:** [July 30, 2010, 11:55pm UTC](https://www.ruby-forum.com/t/question-about-redirect/192009/3 "2010-07-30T23:55:50Z")

</div>

Hello!

On Thu, Jul 22, 2010 at 12:08:16PM +0200, Slask Sklask wrote:

> Firstly I’m a newbie on both mailing lists AND nginx so please be nice to me  
> 😃
> 
> I use nginx as a reverse proxy and it works flawlessly.  
> But now I want to put basic authentication on certain ip addresses.  
> IE.
> 
> If I come from 10.0.0.0/24 network it should go through as usual.  
> But if I come from 10.100.0.0/24 it should have basic authentication.  
> Is there any way to accomplish this?

location / {  
satisfy any;

```
allow 10.0.0.0/24;
deny all;

auth_basic "closed site";
auth_basic_user_file conf/htpasswd;

```

}

Most relevant link is:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Directive “satisfy\_any” was replaced by “satisfy” in 0.6.25.  
Somebody have to fix wiki.

Maxim D.
