162 lines
4.5 KiB
Plaintext
162 lines
4.5 KiB
Plaintext
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
|
|
|
|
# Optimized cache paths
|
|
proxy_cache_path /var/cache/nginx/kopano levels=1:2 keys_zone=kopano_static:10m
|
|
max_size=2g inactive=24h use_temp_path=off;
|
|
|
|
# Upstream with connection pooling
|
|
upstream kopano_backend {
|
|
server 10.0.0.21:443;
|
|
keepalive 32;
|
|
keepalive_requests 1000;
|
|
keepalive_timeout 60s;
|
|
}
|
|
|
|
# WebSocket support map
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name owa.egonetix.de autodiscover.egonetix.de mail.egonetix.de;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 10.0.0.29:443 ssl http2;
|
|
|
|
# SSL config
|
|
ssl_certificate /etc/letsencrypt/live/owa.egonetix.de/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/owa.egonetix.de/privkey.pem;
|
|
ssl_dhparam /etc/ssl/certs/dhparam.pem;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
|
|
server_name owa.egonetix.de autodiscover.egonetix.de mail.egonetix.de;
|
|
|
|
access_log /var/log/nginx/owa-access_log;
|
|
error_log /var/log/nginx/owa-error_log;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 5;
|
|
gzip_types text/plain text/css text/xml text/javascript
|
|
application/json application/javascript application/xml+rss
|
|
application/x-javascript image/svg+xml;
|
|
gzip_min_length 1000;
|
|
|
|
# Default proxy settings
|
|
proxy_http_version 1.1;
|
|
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_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
proxy_set_header Connection "";
|
|
proxy_ssl_session_reuse on;
|
|
proxy_ssl_server_name on;
|
|
|
|
rewrite ^/$ /webapp redirect;
|
|
|
|
# Static files - aggressive caching
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
proxy_pass https://kopano_backend;
|
|
proxy_cache kopano_static;
|
|
proxy_cache_valid 200 24h;
|
|
proxy_cache_valid 404 1m;
|
|
expires 24h;
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
# Buffering for static files
|
|
proxy_buffering on;
|
|
proxy_buffer_size 8k;
|
|
proxy_buffers 32 8k;
|
|
}
|
|
|
|
# WebApp - DISABLE buffering for AJAX responsiveness
|
|
location /webapp {
|
|
proxy_pass https://kopano_backend;
|
|
|
|
# NO caching
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
|
|
# DISABLE buffering for instant AJAX responses
|
|
proxy_buffering off;
|
|
|
|
proxy_read_timeout 300s;
|
|
client_max_body_size 100M;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# ActiveSync - disable buffering for real-time sync
|
|
location /Microsoft-Server-ActiveSync {
|
|
proxy_pass https://kopano_backend;
|
|
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
proxy_buffering off;
|
|
|
|
proxy_read_timeout 3660s;
|
|
client_max_body_size 100M;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# WebMeetings - WebSocket support
|
|
location /webmeetings {
|
|
proxy_pass https://kopano_backend;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
proxy_buffering off;
|
|
proxy_read_timeout 7200s;
|
|
client_max_body_size 500M;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# Autodiscover
|
|
location ~* /Autodiscover/Autodiscover.xml {
|
|
access_log /var/log/nginx/z-push-autodiscover-access.log;
|
|
error_log /var/log/nginx/z-push-autodiscover-error.log;
|
|
|
|
proxy_pass https://kopano_backend;
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
proxy_buffering off;
|
|
proxy_read_timeout 60s;
|
|
client_max_body_size 10M;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# OWA compatibility
|
|
location /owa {
|
|
proxy_pass https://kopano_backend;
|
|
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
proxy_buffering off;
|
|
|
|
proxy_read_timeout 300s;
|
|
client_max_body_size 100M;
|
|
proxy_redirect off;
|
|
}
|
|
|
|
# CalDAV
|
|
location /caldav {
|
|
proxy_pass http://10.0.0.21:8080;
|
|
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
proxy_buffering off;
|
|
|
|
proxy_read_timeout 300s;
|
|
client_max_body_size 50M;
|
|
proxy_redirect off;
|
|
}
|
|
}
|