49 lines
1.0 KiB
Django/Jinja
49 lines
1.0 KiB
Django/Jinja
{% extends "core.j2" %}
|
|
{% block root %}
|
|
root {{ nginx_www_dir }}{{ item.root }};
|
|
index {{ item.index }};
|
|
try_files {{ item.override_try_files | default('try_files $uri $uri/ /index.php$is_args$args') }};
|
|
{% endblock %}
|
|
|
|
{% block location %}
|
|
|
|
## LOCATIONS
|
|
location ~ \.php$ {
|
|
{% if item.upstream_params is defined and item.upstream_params is iterable %}
|
|
{% for param in item.upstream_params %}
|
|
{{ param }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
include fastcgi_params;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
|
|
location ~* \.(txt|js|css|png|jpe?g|gif|ico|svg)$ {
|
|
expires 30d;
|
|
log_not_found off;
|
|
}
|
|
|
|
{% endblock %}
|
|
|
|
{% block app_specific %}
|
|
|
|
location /cfg {
|
|
return 403;
|
|
}
|
|
|
|
location /data {
|
|
deny all;
|
|
}
|
|
{% if item.file_cache is defined and item.file_cache is iterable %}
|
|
{% for param in item.file_cache %}
|
|
open_file_cache {{ param.cache }};
|
|
open_file_cache_valid {{ param.valid }};
|
|
open_file_cache_min_uses {{ param.min_users }};
|
|
open_file_cache_errors {{ param.cache_errors }};
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|