-
-
Save 0wQ/3c6b10c5384070d01dff5c6222001b28 to your computer and use it in GitHub Desktop.
Outlook Exchange Proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.nginx.com/nginx/deployment-guides/load-balance-third-party/microsoft-exchange/ | |
server { | |
listen 80; | |
listen 443 ssl http2; | |
server_name example.com; | |
keepalive_timeout 3h; | |
proxy_read_timeout 3h; | |
tcp_nodelay on; | |
location = / { | |
return 301 '/owa/'; | |
} | |
location = /owa/ { | |
return 302 'https://outlook.live.com/owa/'; | |
} | |
location = /favicon.ico { | |
empty_gif; | |
access_log off; | |
} | |
location / { | |
set $flag 0; | |
if ( $remote_user = '' ) { set $flag 1; } | |
if ( $remote_user = '-' ) { set $flag 1; } | |
if ( $remote_user = 'your_mail@live.com' ) { set $flag 1; } | |
if ( $flag = 0 ) { return 401; } | |
proxy_pass https://www.outlook.com; | |
proxy_buffering off; | |
proxy_http_version 1.1; | |
proxy_request_buffering off; | |
proxy_set_header Connection 'Keep-Alive'; | |
} | |
include ssl.conf; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment