Browse Source

[enh] Deny access to hidden files and handle robots.txt in nginx.conf

pull/1/head
Jérôme Lebleu 10 years ago
parent
commit
1e98b92d70
  1. 11
      conf/nginx.conf
  2. 1
      scripts/install

11
conf/nginx.conf

@ -15,6 +15,17 @@ location {LOCATION} {
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location = {PATH}/robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
# Deny access to hidden files and directories
location ~ ^{PATH}/. {
deny all;
}

1
scripts/install

@ -82,6 +82,7 @@ ynh_app_setting_set "$app" user "$user"
# Copy and set nginx configuration
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
sed -i "s@{PATH}@${path}@g" ../conf/nginx.conf
sed -i "s@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
sed -i "s@{POOLNAME}@${app}@g" ../conf/nginx.conf

Loading…
Cancel
Save