# Unable to configure nginx as reverse proxy

**URL:** <https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954>\
**Category:** NGINX\
**Created:** [February 17, 2012, 3:41pm UTC](https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954 "2012-02-17T15:41:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 17, 2012, 3:41pm UTC](https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954/1 "2012-02-17T15:41:59Z")

</div>

Hi

I am new to nginx and am trying to configure nginx as reverse proxy. Its  
broadcasting on the ip but its not forwarding the requests to the  
backend servers and nothing found in logs as well.

Please let me know where i m doing the mistake.

My topology and config----  
2 webservers where apache is running and am configuring nginx as  
reversee proxy in one of them(X.X.X.9).  
X.X.X.8 is the ip which gets requests from the firewall.

upstream backend {  
server X.X.X.9:80;  
server X.X.X.10:80;  
}  
map $http\_host $name {  
hostnames;  
default 0;  
include domainlist;  
}  
server {  
listen X.X.X.8:80;  
server\_name \_;

location / {  
proxy\_pass [http://backend/$http\_host/](http://backend/$http_host/);  
}  
}

Posted at Nginx Forum:

> **[Unable to configure nginx as reverse proxy](https://forum.nginx.org/read.php?2,222558,222558#msg-222558)**
>
> Hi I am new to nginx and am trying to configure nginx as reverse proxy. Its broadcasting on the ip but its not forwarding the requests to the backend servers and nothing found in logs as well. Please let me know where i m doing the mistake. My...

---

<div class="post-metadata">

**Author:** ![srk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@srk](https://www.ruby-forum.com/u/srk)\
**Post date:** [February 17, 2012, 4:54pm UTC](https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954/2 "2012-02-17T16:54:05Z")

</div>

On 17 Fev 2012 14h41 WET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> reversee proxy in one of them(X.X.X.9).  
> include domainlist;  
> }  
> server {  
> listen X.X.X.8:80;  
> server\_name \_;
> 
> location / {  
> proxy\_pass [http://backend/$http\_host/](http://backend/$http_host/);  
> }  
> }

It’s unclear, for me at least, what you’re trying to achieve. What’s  
the point of setting the $name variable in the above map directive?

Do you want to route the request to separate backends based on the  
Host header? Is that what you want?

Please elaborate.

— appa

---

<div class="post-metadata">

**Author:** ![srk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@srk](https://www.ruby-forum.com/u/srk)\
**Post date:** [February 17, 2012, 7:20pm UTC](https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954/3 "2012-02-17T19:20:00Z")

</div>

No

i just want nginx to work as a software load balancer.

since, there are multiple domains, i just want to map them without the  
need to specify each and every domain name in the conf.

in the file included, i have given entries like this  
.XYZ.org [XYZ.org](http://XYZ.org);

Posted at Nginx Forum:

> **[Re: Unable to configure nginx as reverse proxy](https://forum.nginx.org/read.php?2,222558,222570#msg-222570)**
>
> Hi I am new to nginx and am trying to configure nginx as reverse proxy. Its broadcasting on the ip but its not forwarding the requests to the backend servers and nothing found in logs as well. Please let me know where i m doing the mistake. My...

---

<div class="post-metadata">

**Author:** ![srk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@srk](https://www.ruby-forum.com/u/srk)\
**Post date:** [February 21, 2012, 8:54am UTC](https://www.ruby-forum.com/t/unable-to-configure-nginx-as-reverse-proxy/216954/4 "2012-02-21T08:54:56Z")

</div>

Can someone please share a working config for the above topology i have  
mentioned?

Thanks

Posted at Nginx Forum:

> **[Re: Unable to configure nginx as reverse proxy](https://forum.nginx.org/read.php?2,222558,222767#msg-222767)**
>
> Hi I am new to nginx and am trying to configure nginx as reverse proxy. Its broadcasting on the ip but its not forwarding the requests to the backend servers and nothing found in logs as well. Please let me know where i m doing the mistake. My...
