{{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}}; } }