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

  • NGINX Cookbook
  • Tim Butler
  • 78字
  • 2021-07-03 00:04:24

How to do it...

This recipe is for a basic Drupal configuration, with the Drupal files located in /var/www/html.

Here's the configuration to use:

server { 
    listen       80; 
    server_name  drupal.nginxcookbook.com; 
 
    access_log  /var/log/nginx/drupal.access.log  combined; 
    index index.php; 
 
    root   /var/www/html/; 
 
    location / { 
        try_files $uri $uri/ /index.php?$args; 
    } 
 
    location ~ (^|/)\. { 
        return 403; 
    } 
 
    location ~ /vendor/.*\.php$ { 
        deny all; 
        return 404; 
    } 
 
    location ~ \.php$|^/update.php { 
        fastcgi_pass unix:/var/run/php7.0-fpm.sock; 
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$; 
        fastcgi_index index.php; 
        fastcgi_param SCRIPT_FILENAME 
$document_root$fastcgi_script_name; include fastcgi_params; } }
主站蜘蛛池模板: 南阳市| 水富县| 陇川县| 芒康县| 雷州市| 大安市| 福海县| 惠州市| 库尔勒市| 绥芬河市| 古丈县| 紫金县| 刚察县| 东海县| 东莞市| 黄大仙区| 泗阳县| 光山县| 凤庆县| 马龙县| 朝阳区| 鸡东县| 福安市| 无棣县| 绿春县| 察哈| 池州市| 青州市| 宜城市| 蓝田县| 青岛市| 天等县| 甘孜| 焉耆| 凤冈县| 洪雅县| 灵石县| 报价| 南涧| 乾安县| 库伦旗|