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:
parent
87caa582ba
commit
16f3a5d846
1 changed files with 14 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location ^~ __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/ ;
|
alias __FINALPATH__/ ;
|
||||||
|
@ -9,6 +9,10 @@ location __PATH__/ {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
more_set_headers "Referrer-Policy; origin always";
|
||||||
|
more_set_headers "X-Content-Type-Options: nosniff";
|
||||||
|
more_set_headers "X-XSS-Protection: 1; mode=block";
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file
|
# Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file
|
||||||
|
@ -17,14 +21,16 @@ location __PATH__/ {
|
||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
|
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
|
rewrite ^__PATH__/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php$;
|
||||||
|
include snippets/fastcgi-php.conf;
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
|
||||||
fastcgi_index index.php;
|
#fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
#include fastcgi_params;
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
#fastcgi_param REMOTE_USER $remote_user;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
#fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
#fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
## deny access to all other .php files
|
## deny access to all other .php files
|
||||||
|
@ -34,9 +40,9 @@ location __PATH__/ {
|
||||||
}
|
}
|
||||||
|
|
||||||
## disable all access to the following directories
|
## disable all access to the following directories
|
||||||
location __PATH__/(config|tmp|core|lang) {
|
location ~ ^__PATH__/(config|tmp|core|lang) {
|
||||||
deny all;
|
deny all;
|
||||||
return 403; # replace with 404 to not show these directories exist
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location __PATH__/\.ht {
|
location __PATH__/\.ht {
|
||||||
|
|
Loading…
Add table
Reference in a new issue