官术网_书友最值得收藏!

How it works...

Based on a simple PHP-FPM structure, we make a few key changes specific to the Drupal environment. The first change is as follows:

location ~ (^|/)\. { 
    return 403; 
} 

We put a block in for any files beginning with a dot, which are normally hidden and/or system files. This is to prevent accidental information leakage:

location ~ /vendor/.*\.php$ { 
    deny all; 
    return 404; 
} 

Any PHP file within the vendor directory is also blocked, as they shouldn't be called directly. Blocking the PHP files limits any potential exploit opportunity which could be discovered in third-party code.

Lastly, Drupal 8 changed the way the PHP functions are called for updates, which causes any old configuration to break. The location directive for the PHP files looks like this:

location ~ \.php$|^/update.php { 

This is to allow the distinct pattern that Drupal uses, where the PHP filename could be midway through the URI.

We also modify how the FastCGI process splits the string, so that we ensure we always get the correct answer:

fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 
主站蜘蛛池模板: 勐海县| 泌阳县| 广安市| 龙川县| 宕昌县| 海口市| 奎屯市| 尤溪县| 永仁县| 集贤县| 广饶县| 张家界市| 海原县| 米脂县| 温泉县| 阿勒泰市| 宝山区| 浦东新区| 南丹县| 红桥区| 睢宁县| 铁岭县| 太谷县| 佛学| 扎兰屯市| 杭锦后旗| 泰州市| 文水县| 克什克腾旗| 黎川县| 沧州市| 江孜县| 衡阳县| 苏尼特右旗| 寿光市| 延庆县| 成武县| 景东| 定安县| 汉沽区| 上高县|