# Nginx as Reverse proxy

**URL:** <https://www.ruby-forum.com/t/nginx-as-reverse-proxy/205521>\
**Category:** NGINX\
**Created:** [April 8, 2011, 2:05am UTC](https://www.ruby-forum.com/t/nginx-as-reverse-proxy/205521 "2011-04-08T02:05:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 8, 2011, 2:05am UTC](https://www.ruby-forum.com/t/nginx-as-reverse-proxy/205521/1 "2011-04-08T02:05:57Z")

</div>

Hi all!  
I’m configuring nginx as http reverse proxy. I have another Windows  
server, in this server I’m hosting an application using IIS.  
I’m trying to configure this conditions:

- When enter to [apps.elcomercio.com](http://apps.elcomercio.com) redirects to  
[apps.elcomercio.com/suscriptores](http://apps.elcomercio.com/suscriptores)
- When enter to [apps.elcomercio.com/suscriptores](http://apps.elcomercio.com/suscriptores) redirect to IIS server,  
the complete URL is:  
[http://apps.elcomercio.com/suscriptores/macro/suscriptores\_diario.asp](http://apps.elcomercio.com/suscriptores/macro/suscriptores_diario.asp)

My configuration is:

server {  
listen 80;  
server\_name [apps.elcomercio.com](http://apps.elcomercio.com);  
location ~\* / {  
proxy\_pass [http://suscriptor](http://suscriptor);  
include /etc/nginx/proxy.conf;  
proxy\_cache two;  
}  
location /suscriptores {  
rewrite ^  
[http://apps.elcomercio.com/suscriptores/macro/suscriptores\_diario.asp](http://apps.elcomercio.com/suscriptores/macro/suscriptores_diario.asp)  
permanent;  
}  
}

I can resolve [apps.elcomercio.com](http://apps.elcomercio.com) and when I use elinks I can see the  
webpage.  
Thanks a lot for your support.

Posted at Nginx Forum:

> **[Nginx as Reverse proxy](https://forum.nginx.org/read.php?2,189317,189317#msg-189317)**
>
> Hi all! I'm configuring nginx as http reverse proxy. I have another Windows server, in this server I'm hosting an application using IIS. I'm trying to configure this conditions: - When enter to apps.elcomercio.com redirects to...

---

<div class="post-metadata">

**Author:** ![jacppe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/858c86/32.png) [@jacppe](https://www.ruby-forum.com/u/jacppe)\
**Post date:** [April 8, 2011, 8:22pm UTC](https://www.ruby-forum.com/t/nginx-as-reverse-proxy/205521/2 "2011-04-08T20:22:16Z")

</div>

Well, I accomplish that with the support of my parter.  
The configuration was:

server {  
listen 80;  
server\_name [apps.elcomercio.com](http://apps.elcomercio.com);  
keepalive\_timeout 10 10;  
location ~\* ^/suscriptores/?$ {  
rewrite ^(.\*)$  
[http://apps.elcomercio.com/suscriptores/macro/suscriptores\_diario.asp](http://apps.elcomercio.com/suscriptores/macro/suscriptores_diario.asp)  
permanent;  
#include /etc/nginx/proxy.conf;  
}  
location / {  
proxy\_pass [http://suscriptor](http://suscriptor);  
include /etc/nginx/proxy.conf;  
proxy\_cache two;  
}

}

Posted at Nginx Forum:

> **[Re: Nginx as Reverse proxy](https://forum.nginx.org/read.php?2,189317,189482#msg-189482)**
>
> Hi all! I'm configuring nginx as http reverse proxy. I have another Windows server, in this server I'm hosting an application using IIS. I'm trying to configure this conditions: - When enter to apps.elcomercio.com redirects to...
