roundcube/rootfs/etc/confd/templates/nginx.conf.tmpl

64 lines
1.3 KiB
Cheetah
Raw Normal View History

2016-07-13 15:07:43 +00:00
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;
}
2017-10-06 16:27:06 +00:00
{{if (getenv "DOMAINS")}}
{{range $domain := split (getenv "DOMAINS") ";"}}
2016-07-13 15:07:43 +00:00
server {
listen 80;
2017-10-06 16:27:06 +00:00
server_name {{ $domain }};
2016-07-13 15:07:43 +00:00
root /var/lib/roundcube;
index index.php index.html;
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
client_max_body_size 1G;
2017-10-06 16:27:06 +00:00
2016-10-06 10:35:17 +00:00
add_header X-Clacks-Overhead "GNU Terry Pratchett";
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
location ~ ^/(data|config|\.ht|db_structure\.xml|README|AUTHORS|COPYING-AGPL|COPYING-README) {
deny all;
}
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
location / {
try_files $uri $uri/ index.php;
}
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files $script_name = 404;
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
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;
2016-07-13 15:13:10 +00:00
fastcgi_pass php;
2016-07-13 15:07:43 +00:00
}
2017-10-06 16:27:06 +00:00
2016-07-13 15:07:43 +00:00
location ~* ^.+.(jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}
2017-10-06 16:27:06 +00:00
{{end}}
{{end}}
2016-10-06 10:35:17 +00:00
}