fix: root path in nginx and forbid locations

This commit is contained in:
Matthieu Bessat 2021-08-08 19:53:02 +02:00
parent 14165f6e04
commit 09608ab8bb
2 changed files with 31 additions and 3 deletions

View file

@ -5,6 +5,9 @@ server {
location / {
try_files $uri $uri/ /index.php?$args;
}
location /config.php {
return 404;
}
location ~ \.php$ {
fastcgi_pass unix:{{PHP_SOCKET}};
fastcgi_split_path_info ^(.+\.php)(/.+)$;
@ -12,4 +15,31 @@ server {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
location ^~ /wp-admin {
return 403;
}
location ^~ /super-cool-page {
return 403;
}
location ^~ /load_config.php {
return 403;
}
location ^~ /config.php {
return 403;
}
location ^~ /config.example.php {
return 403;
}
location ^~ /utils.php {
return 403;
}
location ^~ /tmp {
return 403;
}
location ^~ /modules {
return 403;
}
location ^~ /configure_nginx.php {
return 403;
}
}