1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/matomo_ynh.git synced 2024-09-03 19:45:56 +02:00

Update nginx.conf

This commit is contained in:
ericgaspar 2021-05-17 22:58:01 +02:00
parent 5cc0031f57
commit c9c5314939
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -13,12 +13,19 @@ location __PATH__/ {
more_set_headers "X-Content-Type-Options: nosniff";
more_set_headers "X-XSS-Protection: 1; mode=block";
index index.php;
index index.php;
## only allow accessing the following php files
location ~ ^/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php$ {
fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; #replace with the path to your PHP socket file
try_files $uri $uri/ =404;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
## deny access to all other .php files
@ -27,12 +34,10 @@ location __PATH__/ {
return 403;
}
try_files $uri $uri/ =404;
## disable all access to the following directories
location ~ ^__PATH__/(config|tmp|core|lang) {
deny all;
return 403; # replace with 404 to not show these directories exist
return 404;
}
location ~ __PATH__/\.ht {