{% extends "core.j2" %} {% block root %} root {{ nginx_www_dir }}{{ item.root }}; index {{ item.index }}; {% endblock %} {% block location %} location / { try_files {{ item.override_try_files | default('$uri $uri/ =404') }}; } {% endblock %} {% block local_content %} {% if item.manage_local_content is not defined %} # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). # Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban) location ~ /\. { deny all; } {% if item.favicon is defined %} location /favicon.ico { alias {{ item.favicon }}; expires 30d; access_log off; log_not_found off; } {% endif %} location ~* \.(txt|js|css|png|jpe?g|gif|ico|svg)$ { expires 30d; log_not_found off; } {% endif %} {% endblock %} {% block app_specific %} location ~ \.php$ { {% if item.upstream_params is defined and item.upstream_params is iterable %} {% for param in item.upstream_params %} {{ param }} {% endfor %} {% endif %} } {% endblock %}