Skip to content

Instantly share code, notes, and snippets.

@taddev
Last active May 2, 2016 17:20
Show Gist options
  • Save taddev/7275888 to your computer and use it in GitHub Desktop.
Save taddev/7275888 to your computer and use it in GitHub Desktop.
Nginx reverse proxy settings for Exchange 2010/2013 autodiscover.
server {
listen 443;
server_name autodiscover.gwtest.us;
# Enable SSL
ssl on;
ssl_certificate /etc/ssl/nginx/mail.gwtest.us.crt;
ssl_certificate_key /etc/ssl/nginx/mail.gwtest.us.open.key;
ssl_session_timeout 5m;
# Set global proxy settings
proxy_read_timeout 360;
proxy_pass_header Date;
proxy_pass_header Server;
proxy_pass_header Authorization;
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 ~* ^/Autodiscover { proxy_pass https://exch1.test.local; }
error_log /var/log/nginx/owa-ssl-error.log;
access_log /var/log/nginx/owa-ssl-access.log;
}
@mrPsycho
Copy link

i'm trying to set up reverse proxy with this config,
but when i try to set up mail.app in mac os - i got next error:
"Trying to log in to the Exchange server "autodiscover.server.com" failed. Make sure the email address and password you entered are correct, then click Continue".

and i have no idea where is problem... nginx error log is clean.

if mail.app tries to connect to exchange without any proxy - everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment