# Only allow traffic from specific servers

**URL:** <https://www.ruby-forum.com/t/only-allow-traffic-from-specific-servers/229889>\
**Category:** NGINX\
**Created:** [February 14, 2013, 11:56am UTC](https://www.ruby-forum.com/t/only-allow-traffic-from-specific-servers/229889 "2013-02-14T11:56:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mottwsc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b77776/32.png) [@mottwsc](https://www.ruby-forum.com/u/mottwsc)\
**Post date:** [February 14, 2013, 11:56am UTC](https://www.ruby-forum.com/t/only-allow-traffic-from-specific-servers/229889/1 "2013-02-14T11:56:37Z")

</div>

BACKGROUND:  
I will be setting up two servers on a hosted platform. I plan to use  
NGINX  
as a front-end proxy for APACHE. Let’s call the two servers App Server 1  
and  
App Server 2. I also have a server on another hosting platform and that  
has  
my home page. Let’s call that OUTSIDE Server. App Server 1 and App  
Server 2  
will house the application. When the user clicks on the sign in button  
on  
the OUTSIDE Server, the user will be redirected to App Server 1. Basic  
round-robin load balancing through NGINX on App Server 1 will assign the  
user to sign in on either that server (App Server 1) or on App Server 2.

QUESTIONS:  
(1) I want to only allow App Server 1 to accept traffic coming from  
either  
OUTSIDE Server or App Server 2. Even if the user had bookmarked App  
Server  
1, they will need to go back thru OUTSIDE Server to sign in. How do I  
do  
this with NGINX?  
(2) Very similar issue with App Server 2, except that it can only have  
traffic coming from App Server 1. How do I do this with NGINX?

Thanks for any suggestions!

Posted at Nginx Forum:

> **[only allow traffic from specific servers](https://forum.nginx.org/read.php?2,236220,236220#msg-236220)**
>
> BACKGROUND: I will be setting up two servers on a hosted platform. I plan to use NGINX as a front-end proxy for APACHE. Let's call the two servers App Server 1 and App Server 2. I also have a server on another hosting platform and that has my home...

---

<div class="post-metadata">

**Author:** ![mottwsc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b77776/32.png) [@mottwsc](https://www.ruby-forum.com/u/mottwsc)\
**Post date:** [February 14, 2013, 1:13pm UTC](https://www.ruby-forum.com/t/only-allow-traffic-from-specific-servers/229889/2 "2013-02-14T13:13:13Z")

</div>

On Thu, Feb 14, 2013 at 05:55:47AM -0500, mottwsc wrote:

Hi there,

> When the user clicks on the sign in button on  
> the OUTSIDE Server, the user will be redirected to App Server 1.

> QUESTIONS:  
> (1) I want to only allow App Server 1 to accept traffic coming from either  
> OUTSIDE Server or App Server 2. Even if the user had bookmarked App Server  
> 1, they will need to go back thru OUTSIDE Server to sign in. How do I do  
> this with NGINX?

If you use nginx to redirect to the app servers, what you seem to want  
can’t be done.

If you use nginx to proxy\_pass to the app servers, what you seem to want  
can be done. But doing it is unrelated to nginx. Look at the  
configuration  
of the app servers and/or the network devices protecting them.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
