1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

[fix] Imrpove nginx conf without .well-known blocking (fix #2)

This commit is contained in:
Jérôme Lebleu 2016-05-23 10:09:16 +02:00
parent 192a8c3e46
commit df47382a4b

View file

@ -1,10 +1,32 @@
location {LOCATION} {
alias {DESTDIR}/www/;
# Force HTTPS
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
# Default indexes and catch-all
index index.html index.php;
try_files $uri $uri/ index.php;
try_files $uri $uri/ {PATH}/index.php?$args;
# Prevent useless logs
location = {PATH}/favicon.ico {
log_not_found off;
access_log off;
}
location = {PATH}/robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny access to hidden files and directories
location ~ ^{PATH}/(.+/|)\.(?!well-known\/) {
deny all;
}
# Execute and serve PHP files
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-{POOLNAME}.sock;
@ -15,17 +37,6 @@ 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;
}