Compensation faille de sécurité NginX+PHP-FPM

This commit is contained in:
VC
2019-11-19 07:26:03 +01:00
parent 1ec309b984
commit a3fa0e1162
5 changed files with 7 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ server {
## Inter PHP en path_info ## Inter PHP en path_info
location ~ ^/(index).php(/.*)+ { location ~ ^/(index).php(/.*)+ {
fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_split_path_info ^(.+\.php)(/.*)$;
try_files $fastcgi_script_name =404;
fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock;
include fastcgi_params; include fastcgi_params;
} }

View File

@@ -6,6 +6,8 @@ server {
allow 10.233.212.64/27; allow 10.233.212.64/27;
allow 2a01:cb0c:8516:7f00::/64; allow 2a01:cb0c:8516:7f00::/64;
allow 83.167.52.81; allow 83.167.52.81;
allow 163.172.112.19;
allow 2001:bc8:26c1:103::/64;
allow 2001:1b48:2:103::/64; allow 2001:1b48:2:103::/64;
allow 2001:bc8:26c1:101::/64; allow 2001:bc8:26c1:101::/64;
deny all; deny all;

View File

@@ -24,6 +24,7 @@ server {
location ~ /(app).php(/.*)+ { location ~ /(app).php(/.*)+ {
fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_split_path_info ^(.+\.php)(/.*)$;
try_files $fastcgi_script_name =404;
fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock; fastcgi_pass unix:/var/run/php/php{{ php_version }}-fpm.sock;
fastcgi_read_timeout 60; fastcgi_read_timeout 60;
include fastcgi_params; include fastcgi_params;

View File

@@ -37,7 +37,7 @@ server {
gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
location / { location / {
rewrite ^ /index.php$request_uri; rewrite ^ /index.php;
} }
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
@@ -50,6 +50,7 @@ server {
location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
try_files $fastcgi_script_name =404;
fastcgi_param modHeadersAvailable true; fastcgi_param modHeadersAvailable true;
fastcgi_param front_controller_active true; fastcgi_param front_controller_active true;
fastcgi_intercept_errors on; fastcgi_intercept_errors on;

View File

@@ -61,6 +61,7 @@ server {
# Interprétation PHP # Interprétation PHP
location ~ ^/(index).php(/.*)+ { location ~ ^/(index).php(/.*)+ {
fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_split_path_info ^(.+\.php)(/.*)$;
try_files $fastcgi_script_name =404;
fastcgi_cache wpdojo; fastcgi_cache wpdojo;
fastcgi_cache_key $request_method$host$request_uri; fastcgi_cache_key $request_method$host$request_uri;
fastcgi_cache_valid any 15m; fastcgi_cache_valid any 15m;