summaryrefslogtreecommitdiff
path: root/templates/server.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/server.tmpl')
-rw-r--r--templates/server.tmpl43
1 files changed, 43 insertions, 0 deletions
diff --git a/templates/server.tmpl b/templates/server.tmpl
new file mode 100644
index 0000000..38641b5
--- /dev/null
+++ b/templates/server.tmpl
@@ -0,0 +1,43 @@
+{{if .UpstreamName}}upstream {{.UpstreamName}} {
+ {{range .Upstream}}server {{.}};
+ {{end}}
+}
+{{end}}
+server {
+ listen {{.Port}};
+ {{if .SSL}}listen {{.PortSSL}} ssl {{.SPDY}};{{end}}
+ root {{.Root}};
+
+ server_name {{range .ServerName}}{{.}} {{end}};
+ index {{range .Index}}{{.}} {{end}};
+
+ {{if .AccessLog}}access_log {{.AccessLog}};{{end}}
+ {{if .ErrorLog}}error_log {{.ErrorLog}};{{end}}
+
+ # Settings for TLS
+ {{if .SSL}}ssl_certificate {{.SSL_Cert}};
+ ssl_certificate_key {{.SSL_Cert_Key}};
+ {{template "ssl.tmpl" .}}{{else}}# Empty{{end}}
+
+ # Basic PHP configuration
+ {{if .UsePHP}}location ~ \.php$ {
+ include snippets/fastcgi-php.conf;
+ {{if not .PHP_TCP}}fastcgi_pass unix:/var/run/php5-fpm.sock;{{end}}
+ }{{else}}# Empty{{end}}
+
+ # Disallow crawlers
+ {{if .Robots}}{{template "robots.tmpl" .}}{{else}}# Empty{{end}}
+
+ # Cache static content
+ {{if .Cache_Static}}{{template "cache_static.tmpl" .}}{{else}}# Empty{{end}}
+
+ # Google Pagespeed settings
+ {{if .Pagespeed}}{{template "pagespeed.tmpl" .}}{{else}}# Empty{{end}}
+
+ # Disallow Facebook to crawl your sites
+ {{if .Block_Facebook}}{{template "block_facebook.tmpl" .}}{{else}}# Empty{{end}}
+
+ location / {
+ try_files $uri $uri/{{if .UsePHP}} /index.php?$args{{end}};
+ }
+}