nginx/templates/etc/nginx/sites-available/hubzilla.j2
muppeth 47df845011 small fix for hubzilla template (#12)
Co-authored-by: muppeth <muppeth@disroot.org>
Reviewed-on: #12
Reviewed-by: meaz <meaz@no-reply@disroot.org>
Reviewed-by: antilopa <antilopa@no-reply@disroot.org>
Co-authored-by: muppeth <muppeth@no-reply@disroot.org>
Co-committed-by: muppeth <muppeth@no-reply@disroot.org>
2021-05-20 09:07:28 +00:00

66 lines
1.1 KiB
Django/Jinja

{% extends "core.j2" %}
{% block root %}
root {{ nginx_www_dir }}{{ item.root }};
index index.php;
charset utf-8;
include mime.types;
autoindex off;
{% endblock %}
{% block location %}
## LOCATIONS
location / {
rewrite ^/\.well\-known/.* /index.php?q=$1;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1;
}
}
location ^~ /.well-known/ {
allow all;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1;
}
}
location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ {
expires 30d;
try_files $uri /index.php?q=$uri&$args;
}
# block these file types
location ~* \.(tpl|md|tgz|log|out)$ {
deny all;
}
location ~* \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
{% if item.upstream_params is defined and item.upstream_params is iterable %}
{% for param in item.upstream_params %}
{{ param }}
{% endfor %}
{% endif %}
}
location ~ /\. {
deny all;
}
location ~ "(^|/)store" {
deny all;
}
location ~ "(^|/)\.git" {
return 403;
}
location ~ /util {
deny all;
}
{% endblock %}