mirror of
https://github.com/YunoHost-Apps/my_webapp_ynh.git
synced 2024-09-03 19:46:26 +02:00
[enh] Deny access to hidden files and handle robots.txt in nginx.conf
This commit is contained in:
parent
f48ff2c48e
commit
1e98b92d70
2 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,17 @@ location {LOCATION} {
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location = {PATH}/robots.txt {
|
||||||
|
allow all;
|
||||||
|
log_not_found off;
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Include SSOWAT user panel.
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Deny access to hidden files and directories
|
||||||
|
location ~ ^{PATH}/. {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
|
@ -82,6 +82,7 @@ ynh_app_setting_set "$app" user "$user"
|
||||||
|
|
||||||
# Copy and set nginx configuration
|
# Copy and set nginx configuration
|
||||||
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
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@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
|
||||||
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
|
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
|
||||||
sed -i "s@{POOLNAME}@${app}@g" ../conf/nginx.conf
|
sed -i "s@{POOLNAME}@${app}@g" ../conf/nginx.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue