Welcome! Log In Create A New Profile

Advanced

Nginx in front of Exchange 2010 / Activesync

Posted by sachsenpaulchen 
Nginx in front of Exchange 2010 / Activesync
August 15, 2014 11:34AM
Hi guys,

i finally need some help using Nginx as reverse proxy for an Exchange 2010
OWA is working perfectly, certificates is all fine, but active sync with android devices is not working.

here is the Config
==============
server {
listen 443;
server_name owa.mydomain.de;

# Redirect from "/" to "/owa" by default
location / {return 301 https://owa.mydomain.de/owa;}


# Enable SSL
ssl on;
ssl_certificate /etc/nginx/certs/owa.crt;
ssl_certificate_key /etc/nginx/certs/privatekey.pem;
ssl_session_timeout 5m;

# Set global proxy settings
proxy_read_timeout 360;
proxy_connect_timeout 360;

proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_pass_header Authorization;
proxy_pass_header Date;
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";

location /owa { proxy_pass https://192.168.0.1/owa; }
location /ews { proxy_pass https://192.168.0.1/ews; }
location /rpc { proxy_pass https://192.168.0.1/rpc; }
location /exchweb { proxy_pass https://192.168.0.1/exchweb; }
location /public { proxy_pass https://192.168.0.1/public; }
location /exchange { proxy_pass https://192.168.0.1/exchange; }
location /Microsoft-Server-ActiveSync {
proxy_set_header X-Forwarded-Proto https;
proxy_pass https://192.168.0.1/Microsoft-Server-ActiveSync;
}
error_log /var/log/nginx/exchange-ssl-error.log;
access_log /var/log/nginx/exchange-ssl-access.log;
}

The error log says:

2014/08/15 17:26:31 [error] 16474#0: *239 upstream prematurely closed connection while reading response header from upstream, client: 98.122.1.31, server: owa.mydomain.de, request: "POST /Microsoft-Server-ActiveSync?Cmd=Sync&User=username%5Cda&DeviceId=androidc187814&DeviceType=Android HTTP/1.1", upstream: "https://192.168.0.1:443/Microsoft-Server-ActiveSync?Cmd=Sync&User=username%5Cda&DeviceId=androidc187814&DeviceType=Android", host: "owa.mydomain.de"

I have absolutely no idea what else i can do to fix that. Connecting with the androids directly to the exchange
server works perfectly. When nginx is between, no work :(

Please help! Thanks in advance!
Re: Nginx in front of Exchange 2010 / Activesync
August 15, 2014 01:33PM
Try it with AJP for active sync: https://github.com/yaoweibin/nginx_ajp_module
It solved it for me with syncml.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Nginx in front of Exchange 2010 / Activesync
August 16, 2014 10:20AM
Hi Mate.

Thank you for your quick answer. Never heard of that. have a short idea how to use it here?

Thank you again!
Re: Nginx in front of Exchange 2010 / Activesync
August 16, 2014 12:15PM
See the wiki https://github.com/yaoweibin/nginx_ajp_module/wiki
I've committed everything you need to compile it for Windows, or use a pre-build version at http://nginx-win.ecsds.eu/
Re: Nginx in front of Exchange 2010 / Activesync
February 24, 2016 11:39AM
I finally got ActiveSync working with the configuration I wrote up here.

http://blog.adamjoshuasmith.com/deploying-exchange-2016-behind-nginx-free/

Maybe that will work for you.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready