nginx/templates/etc/nginx/sites-available/privatebin.j2

56 lines
976 B
Django/Jinja

{% extends "core.j2" %}
{% block root %}
root {{ nginx_www_dir }}{{ item.root }};
index {{ item.index }};
try_files {{ item.override_try_files | default('$uri $uri/ /index.php') }};
{% 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 extra_upstreams %}
map $http_user_agent $pastebin_badagent {
~*bot 1;
~*spider 1;
~*crawl 1;
~https?:// 1;
WhatsApp 1;
SkypeUriPreview 1;
facebookexternalhit 1;
}
{% endblock %}
{% block app_specific %}
if ($pastebin_badagent) {
return 403;
}
location /cfg {
return 403;
}
location /data {
deny all;
}
{% endblock %}