7.3. List of Template Nginx Configuration FilesΒΆ

See Install Nginx for more details.

fastcgi.conf.tmpl

server {
  resolver @resolver@;
  listen 80;
  server_name @server_name@;
  root /var/www/@root@;
  index index.html index.htm index.php;

  location ~ ^(.+?\.php)(/.*)?$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$1;
    set $backend "@fastcgi_server@";
    fastcgi_pass $backend;
  }
}

fastcgi.tls.conf.tmpl

server {
  resolver @resolver@;
  listen 443 ssl;
  server_name @server_name@;
  root /var/www/@root@;
  index index.html index.htm index.php;

  ssl_certificate     /etc/nginx/conf.d/tls/dummy.crt;
  ssl_certificate_key /etc/nginx/conf.d/tls/dummy.key;

  location ~ ^(.+?\.php)(/.*)?$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$1;
    set $backend "@fastcgi_server@";
    fastcgi_pass $backend;
  }
}

reverse-proxy.tls.conf.tmpl

server {
  resolver @resolver@;
  listen 443 ssl;
  server_name @server_name@;
  ssl_certificate     /etc/nginx/conf.d/tls/dummy.crt;
  ssl_certificate_key /etc/nginx/conf.d/tls/dummy.key;

  location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    set $backend "http://@web_server@";
    proxy_pass $backend;
  }
}

redirect-https.conf.tmpl

server {
        listen 80;
        server_name @server_name@;
        return 301 https://$server_name$request_uri;  # enforce https
}

uwsgi.conf.tmpl

server {
  resolver @resolver@;
  listen 80;
  server_name @server_name@;

  location / {
    set $backend "@uwsgi_server@";
    uwsgi_pass $backend;
    include uwsgi_params;
  }
}

uwsgi.tls.conf.tmpl

server {
  resolver @resolver@;
  listen 443 ssl;
  server_name @server_name@;
  ssl_certificate     /etc/nginx/conf.d/tls/dummy.crt;
  ssl_certificate_key /etc/nginx/conf.d/tls/dummy.key;

  location / {
    set $backend "@uwsgi_server@";
    uwsgi_pass $backend;
    include uwsgi_params;
  }
}