mailcow/data/conf/nginx/site.conf

117 lines
3.9 KiB
Plaintext
Raw Normal View History

2016-12-09 20:39:02 +01:00
server {
include /etc/nginx/conf.d/listen.active;
2016-12-22 12:20:26 +01:00
ssl on;
ssl_certificate /etc/ssl/mail/cert.pem;
ssl_certificate_key /etc/ssl/mail/key.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
2017-01-09 20:22:44 +01:00
ssl_ciphers 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA256:EECDH:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!IDEA:!ECDSA:kEDH:CAMELLIA128-SHA:AES128-SHA';
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
2016-12-22 12:20:26 +01:00
ssl_ecdh_curve secp384r1;
index index.php index.html;
server_name _ autodiscover.* autoconfig.*;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /web;
2016-12-09 20:39:02 +01:00
2016-12-27 20:28:30 +01:00
location = /principals/ {
rewrite ^ https://$host/SOGo/dav;
allow all;
}
2016-12-22 12:20:26 +01:00
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PHP_VALUE "max_execution_time = 1200
max_input_time = 1200
memory_limit = 64M";
fastcgi_read_timeout 1200;
2016-12-22 12:20:26 +01:00
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
rewrite ^(/save.+)$ /rspamd$1 last;
location /rspamd/ {
proxy_pass http://rspamd:11334/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
location ^~ /inc/init.sql {
deny all;
}
2016-12-14 15:56:30 +01:00
2016-12-22 12:20:26 +01:00
if ($host ~* autodiscover\.(.*)) {
rewrite ^(.*) /autodiscover.php last;
}
2016-12-21 12:16:05 +01:00
2016-12-22 12:20:26 +01:00
if ($host ~* autoconfig\.(.*)) {
rewrite ^(.*) /autoconfig.php last;
}
2016-12-21 12:16:05 +01:00
2016-12-22 12:20:26 +01:00
location ^~ /Microsoft-Server-ActiveSync {
2017-01-15 17:37:25 +01:00
proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync;
2016-12-22 12:20:26 +01:00
proxy_connect_timeout 1000;
proxy_next_upstream timeout error;
proxy_send_timeout 1000;
proxy_read_timeout 1000;
proxy_buffer_size 8k;
proxy_buffers 4 32k;
proxy_temp_file_write_size 64k;
proxy_busy_buffers_size 64k;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$host:$server_port;
2016-12-22 12:20:26 +01:00
proxy_set_header x-webobjects-server-port $server_port;
client_body_buffer_size 128k;
client_max_body_size 100m;
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
location ^~ /SOGo {
proxy_pass http://sogo:20000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header x-webobjects-server-protocol HTTP/1.0;
proxy_set_header x-webobjects-remote-host $remote_addr;
proxy_set_header x-webobjects-server-name $server_name;
proxy_set_header x-webobjects-server-url $scheme://$host:$server_port;
2016-12-22 12:20:26 +01:00
proxy_set_header x-webobjects-server-port $server_port;
#proxy_connect_timeout 90;
#proxy_send_timeout 90;
#proxy_read_timeout 90;
#proxy_buffer_size 4k;
#proxy_buffers 4 32k;
#proxy_busy_buffers_size 64k;
#proxy_temp_file_write_size 64k;
client_body_buffer_size 128k;
client_max_body_size 100m;
break;
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
location /SOGo.woa/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
allow all;
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
location /SOGo/WebServerResources/ {
alias /usr/lib/GNUstep/SOGo/WebServerResources/;
allow all;
}
2016-12-09 20:39:02 +01:00
2016-12-22 12:20:26 +01:00
location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$ {
alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
}
2016-12-09 20:39:02 +01:00
}