forked from runeasymail/easymail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx_config_for_autoconfig_and_autodiscover
56 lines (47 loc) · 1.45 KB
/
nginx_config_for_autoconfig_and_autodiscover
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
53
54
55
56
server {
listen 443;
server_name autoconfig.* autodiscover.*;
root /usr/share/nginx/autoconfig_and_autodiscover;
index index.php index.html index.htm;
error_log /var/log/nginx/error.log;
ssl on;
ssl_certificate /etc/dovecot/dovecot.pem;
ssl_certificate_key /etc/dovecot/private/dovecot.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 ref: POODLE
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
location /autodiscover/autodiscover.xml {
try_files $uri /autodiscover.php?$args;
rewrite ^(.+)$ /autodiscover.php?$1 last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name autoconfig.* autodiscover.*;
root /usr/share/nginx/autoconfig_and_autodiscover;
index index.php index.html index.htm;
error_log /var/log/nginx/error.log;
location /mail/config-v1.1.xml {
try_files $uri /autoconfig.php?$args;
rewrite ^(.+)$ /autoconfig.php?$1 last;
}
location /autodiscover/autodiscover.xml {
try_files $uri /autodiscover.php?$args;
rewrite ^(.+)$ /autodiscover.php?$1 last;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}