worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile off; keepalive_timeout 65; gzip off; upstream php { server 127.0.0.1:9000; } server { listen 80; server_name {{ getenv "DOMAIN"}}; root /var/lib/roundcube; index index.php index.html; client_max_body_size 1G; location ~ ^/(data|config|\.ht|db_structure\.xml|README|AUTHORS|COPYING-AGPL|COPYING-README) { deny all; } location / { try_files $uri $uri/ index.php; } location ~ ^(?.+?\.php)(?/.*)?$ { try_files $script_name = 404; include fastcgi_params; fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS on; fastcgi_read_timeout 300; fastcgi_pass php_roundcube; } location ~* ^.+.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ { expires 30d; access_log off; } } }