# Nginx as proxy for Exchange 2013 : RPC?

**URL:** <https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061>\
**Category:** NGINX\
**Created:** [February 13, 2016, 1:28pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061 "2016-02-13T13:28:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [February 13, 2016, 1:28pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/1 "2016-02-13T13:28:59Z")

</div>

I’ve been searching the internet and tried a few approaches, but I was  
wondering:

Is it possible to use Nginx (non-plus edition) as a proxy for Exchange  
(2013) - in particular: RPC. I did manage to get the other stuff  
working.  
Maybe by installing/enabling a (free) module?

If so, would someone be so kind to share a working config?

Posted at Nginx Forum:

> **[Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264518#msg-264518)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...

---

<div class="post-metadata">

**Author:** ![jbostoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jbostoen](https://www.ruby-forum.com/u/jbostoen)\
**Post date:** [February 13, 2016, 2:29pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/2 "2016-02-13T14:29:44Z")

</div>

> **[reverse proxying exchange 2013, rdp over ssl and sstp vpn](https://forum.nginx.org/read.php?11,261682,261769)**
>
> Hello all, I need to publish an Exchange Server 2013 (OWA, EWS) on one server, remote desktop via ssl gateway (rdweb gateway) on another server and an sstp vpn (windows ssl vpn) on a third server, all behind a simple router with one public ip address...

Posted at Nginx Forum:

> **[Re: Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264519#msg-264519)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...

---

<div class="post-metadata">

**Author:** ![jbostoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jbostoen](https://www.ruby-forum.com/u/jbostoen)\
**Post date:** [February 13, 2016, 3:03pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/3 "2016-02-13T15:03:37Z")

</div>

It doesn’t seem to mention the RPC (not RDP)?

Posted at Nginx Forum:

> **[Re: Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264520#msg-264520)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...

---

<div class="post-metadata">

**Author:** ![jbostoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jbostoen](https://www.ruby-forum.com/u/jbostoen)\
**Post date:** [February 13, 2016, 3:56pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/4 "2016-02-13T15:56:47Z")

</div>

So I just need a stream and proxy\_pass it to our Exchange? (I’m new to  
Nginx, haven’t seen stream config before; we’re using SSL for  
everything).

Also, is it possible to have a combination? The deal is: the current  
setup  
in our company is only 1 public IP address for a couple of services.  
Which  
used to be fine, since SSL was only used for Exchange (and our firewall  
was  
configured to only send the HTTP-traffic to the Nginx, and HTTPS to  
Exchange). But now, I need to able to split it out, based on the names (  
apps.domain.ext and mail.domain.ext ).

Posted at Nginx Forum:

> **[Re: Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264523#msg-264523)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...

---

<div class="post-metadata">

**Author:** ![jbostoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jbostoen](https://www.ruby-forum.com/u/jbostoen)\
**Post date:** [February 13, 2016, 3:12pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/5 "2016-02-13T15:12:23Z")

</div>

If data is a tcp stream use stream, if not then a http {} block should  
work.

> **[Re: Using NGINX as reverse proxy for OWA](https://forum.nginx.org/read.php?2,14903,35128#msg-35128)**
>
> Hi there, I am trying to get NGINX running as some proxy for accessing OWA. My aim is to provide company-internal OWA also externally but through NGINX which will be running on the gateway then. I followed the instructions of...

> **[ITPro Today: IT News, How-Tos, Trends, Case Studies, Career Tips, More](https://www.itprotoday.com)**
>
> IT Pro Today Homepage

Posted at Nginx Forum:

> **[Re: Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264522#msg-264522)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...

---

<div class="post-metadata">

**Author:** ![jbostoen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bcef8e/32.png) [@jbostoen](https://www.ruby-forum.com/u/jbostoen)\
**Post date:** [February 14, 2016, 12:22pm UTC](https://www.ruby-forum.com/t/nginx-as-proxy-for-exchange-2013-rpc/244061/6 "2016-02-14T12:22:56Z")

</div>

I’ve had most success so far with this approach (Tigunov’s config -  
[https://gist.github.com/taddev/7275873](https://gist.github.com/taddev/7275873)).  
( btw, I’m using Basic Authentication rather than NTLM ).

server {  
server\_name [mail.contoso.com](http://mail.contoso.com);  
server\_name [autodiscover.contoso.com](http://autodiscover.contoso.com);  
keepalive\_timeout 3h;  
proxy\_read\_timeout 3h;  
#reset\_timedout\_connection on;  
tcp\_nodelay on;  
listen 443 ssl;  
client\_max\_body\_size 3G;  
#proxy\_pass\_header Authorization;  
proxy\_pass\_header Date;  
proxy\_pass\_header Server;  
proxy\_set\_header X-Real-IP $remote\_addr;  
proxy\_set\_header Accept-Encoding “”;  
proxy\_pass\_request\_headers on;  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_http\_version 1.1;  
proxy\_request\_buffering off;  
proxy\_buffering off;  
proxy\_set\_header Connection “Keep-Alive”;

```
location / {
        proxy_pass https://exchange.internal/;
        proxy_next_upstream error timeout invalid_header http_500

```

http\_503;  
}

}

With Microsoft’s Remote Connectivity Analyzer, I now get up to the  
point  
where ActiveSync is tested. “OPTIONS” works, FolderSync fails (  
something  
about a request being aborted or canceled, no further details ).

Posted at Nginx Forum:

> **[Re: Nginx as proxy for Exchange 2013 : RPC?](https://forum.nginx.org/read.php?2,264518,264529#msg-264529)**
>
> I've been searching the internet and tried a few approaches, but I was wondering: Is it possible to use Nginx (non-plus edition) as a proxy for Exchange (2013) - in particular: RPC. I did manage to get the other stuff working. Maybe by...
