-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexchange2010-16
52 lines (47 loc) · 2.2 KB
/
exchange2010-16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
###########################################################################################
# BEFORE YOU USE THIS CODE #
# Use 'BASIC' authentication within the Outlook Anywhere connection setup #
# !unless you have the pro edition!. #
# 'Windows Authentication' is disabled in your IIS application settings for EWS, OWA etc. #
# as NGINX will return an error 401 if 'Basic Authentication' is not enabled #
###########################################################################################
server {
listen 443 ssl;
server_name [domainname] [domainname2];
location / {
return 301 https://[domainname]/owa;
}
ssl_certificate /etc/letsencrypt/live/[domainname]/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/[domainname]/privkey.pem;
client_max_body_size 3G;
proxy_request_buffering off;
ssl_session_timeout 5m;
tcp_nodelay on;
proxy_http_version 1.1;
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;
proxy_pass_request_headers on;
more_set_input_headers 'Authorization: $http_authorization';
proxy_set_header Accept-Encoding "";
more_set_headers -s 401 'WWW-Authenticate: Basic realm="fqlocaldomain"';
proxy_buffering off;
proxy_set_header Connection "Keep-Alive";
location ~* ^/owa { proxy_pass https://fqlocaldomain; }
location ~* ^/Microsoft-Server-ActiveSync { proxy_pass https://fqlocaldomain; }
location ~* ^/ecp { proxy_pass https://fqlocaldomain; }
location ~* ^/rpc { proxy_pass https://fqlocaldomain; }
location ~* ^/mapi { proxy_pass https://fqlocaldomain; }
location ~* ^/ews { proxy_pass https://fqlocaldomain; }
location ~* ^/autodiscover { proxy_pass https://fqlocaldomain; }
}
server {
listen 80;
#listen [::]:80;
server_name [domainname] [domainname2];
return 301 https://[domainname];
}