Welcome! Log In Create A New Profile

Advanced

Using NGINX as reverse proxy for OWA

October 19, 2009 07:38AM
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 http://planetit.ws/linux/debian/configuring-nginx-based-reverse-proxy-for-owa.html to set it up. But I keep getting confusing "Content Encoding Errors".

Let me explain what I did:

[hr]
[list=1]
[*] I installed NGINX via apt-get on my Ubuntu machine.
[hr]
[*] I slightly changed the nginx.conf so it lookes like this now:

[size=x-small]user www-data;
worker_processes 2;

error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type text/plain;

access_log /var/log/nginx/access.log;

tcp_nopush off;
keepalive_timeout 65;
tcp_nodelay on;

msie_padding on;
msie_refresh off;
server_name_in_redirect off;
server_names_hash_max_size 512;
server_names_hash_bucket_size 64;

gzip off;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}[/size]

[hr]
[*] Then I created some file "http-proxy" in the sites-available folder with the following content...

[size=x-small]server {
listen 80;
server_name 192.168.10.157;
rewrite ^(,*) https://192.168.10.157$1 permanent;
}[/size]

...and enabled it.
[hr]
[*] Now I created the file "https-proxy" with the following content...

[size=x-small]server {
listen 443;
server_name 192.168.10.157;

rewrite ^/$ https://192.168.10.157/exchange permanent;

ssl on;
ssl_certificate /etc/ssl/certs/myssl.crt;
ssl_certificate_key /etc/ssl/private/myssl.key;
ssl_session_timeout 5m;

proxy_read_timeout 360;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

location /exchange { proxy_pass https://sbs.domain.local/exchange; }
location /exchweb { proxy_pass https://sbs.domain.local/exchweb; }
location /public { proxy_pass https://sbs.domain.local/public; }
# location /Microsoft-Server-ActiveSync { proxy_pass https://sbs.domain.local/Microsoft-Server-ActiveSync; }
}[/size]

...and enabled it. As you can see the file is almost the same like on the manual mentioned above. As we are still using SBS 2003 I changed the location directive accordingly.
[hr]
[*] Now I created my SSL cerificates. I followed the instructions on http://articles.slicehost.com/2007/12/19/ubuntu-gutsy-self-signed-ssl-certificates-and-nginx ... not to miss a thing. ;-)
[hr]
[*] To be sure that the NGINX machine can resolve sbs.domain.local I added some entry in /etc/hosts.
[hr]
[*] I played around with several changes, i.e. ...
[list]
[*] ... taking over the SBS' SSL certificate
[*] ... addressing the NGINX machine with its machine name
[*] ... turning GZIP on and off.
[/list]
... No luck!
[/list]
[hr]
I am sure that it's just a small thing that I might have forgotten. But I have no idea where to look. What can you suggest?

CU,
Mészi.
Subject Author Posted

Using NGINX as reverse proxy for OWA

meszi October 19, 2009 07:38AM

RE: Using NGINX as reverse proxy for OWA

Ben Vincent October 19, 2009 09:48AM

Re: RE: Using NGINX as reverse proxy for OWA

meszi October 19, 2009 10:18AM

Re: Using NGINX as reverse proxy for OWA

Michael Nolte - Stadt Weener (Ems) December 29, 2009 12:50PM

Re: Using NGINX as reverse proxy for OWA

Ryan Malayter December 30, 2009 02:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 191
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