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

  • 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; } }
主站蜘蛛池模板: 合水县| 永安市| 奉节县| 扎鲁特旗| 开远市| 莎车县| 恩施市| 新巴尔虎左旗| 苏州市| 名山县| 乌拉特中旗| 沙雅县| 昭苏县| 奉贤区| 堆龙德庆县| 西峡县| 当雄县| 鸡泽县| 读书| 太原市| 博野县| 张家港市| 澎湖县| 广饶县| 溧水县| 克山县| 宁晋县| 塘沽区| 石台县| 麻城市| 涪陵区| 新兴县| 罗田县| 宣化县| 余姚市| 大港区| 原阳县| 霍邱县| 大田县| 丹棱县| 克什克腾旗|