<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Difficulty in Proxying for MS Exchange Web Access using NGINX</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=2>Hi Igor,<BR>
<BR>
Please allow me to thank you for your efforts in coming up and maintaining such a wonderful piece of software! Its fast, stable and light on resources ... truly an amazing piece of work!<BR>
<BR>
I am running the nginx-0.6.25 software on Ubuntu Server 7.10. I was able to set up the web services and proxy them to web sites running PHP-based applications. Finally, I was able to proxy http traffic inside https using nginx. However, I am having difficulty doing the same for the MS Web Service for Exchange.<BR>
<BR>
The weird thing is ... if I connect to <A HREF="http://ns1.nexustech.com.ph/exchange/">http://ns1.nexustech.com.ph/exchange/</A> ... everything works! Here are the pertinent config entries:<BR>
<BR>
&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp; server {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 80;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name&nbsp;&nbsp;&nbsp;&nbsp; ns1.nexustech.com.ph;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; access_log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /var/log/nginx/access_http.log main;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location / {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_pass&nbsp;&nbsp; <A HREF="http://192.168.0.135;">http://192.168.0.135;</A><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header&nbsp;&nbsp;&nbsp;&nbsp; Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $http_host;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;&nbsp;&nbsp; }<BR>
<BR>
But if I were to connect using <A HREF="https://ns1.nexustech.com.ph/exchange/">https://ns1.nexustech.com.ph/exchange/</A> .... I get the connected and everything but some functions do not work properly ... in fact, what seems to happen is that it tries to keep connecting back to the http port ... I have tried enabling proxy_redirect but I can't seem to get the right redirection ...<BR>
<BR>
Anyway, here is the https section:<BR>
<BR>
&nbsp;&nbsp;&nbsp; server {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 443;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name&nbsp; ns1.nexustech.com.ph;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; access_log&nbsp; /var/log/nginx/access_https.log&nbsp; main;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssl_certificate&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /etc/ssl/certs/cert.crt;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssl_certificate_key&nbsp; /etc/ssl/private/cert.key;<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location / {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_pass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://192.168.0.135;">http://192.168.0.135;</A><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; proxy_set_header&nbsp;&nbsp;&nbsp; Host&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $http_host;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
<BR>
And here are some log entries from the access_https.log:<BR>
<BR>
202.175.215.131 - - [02/Feb/2008:22:52:17 +0800] GET /exchange? HTTP/1.1 &quot;401&quot; 83 &quot;-&quot; &quot;RPT-HTTPClient/0.3-3E&quot; &quot;-&quot;<BR>
202.175.215.131 - - [02/Feb/2008:22:52:17 +0800] GET /exchange? HTTP/1.1 &quot;401&quot; 83 &quot;-&quot; &quot;RPT-HTTPClient/0.3-3E&quot; &quot;-&quot;<BR>
<BR>
And from the access_http.log:<BR>
<BR>
124.6.189.254 - mario [02/Feb/2008:23:08:02 +0800] POST /exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML HTTP/1.1 &quot;302&quot; 0 &quot;<A HREF="http://ns1.nexustech.com.ph/exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML?Cmd=edit">http://ns1.nexustech.com.ph/exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML?Cmd=edit</A>&quot; &quot;Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11&quot; &quot;-&quot;<BR>
124.6.189.254 - mario [02/Feb/2008:23:08:03 +0800] GET /exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML?Cmd=edit HTTP/1.1 &quot;200&quot; 3212 &quot;<A HREF="http://ns1.nexustech.com.ph/exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML?Cmd=edit">http://ns1.nexustech.com.ph/exchange/mfarroyo/Drafts/Difficulty%20in%20Proxying%20for%20MS%20Exchange%20Web%20Access%20using%20NGINX.EML?Cmd=edit</A>&quot; &quot;Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11&quot; &quot;-&quot;<BR>
/var/log/nginx/access_http.log (END)<BR>
<BR>
Thanks in advance for your help!<BR>
<BR>
Mario<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>