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

  • 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; } }
主站蜘蛛池模板: 启东市| 博客| 无为县| 老河口市| 赣州市| 沙湾县| 天长市| 从江县| 宁河县| 霍林郭勒市| 青海省| 富锦市| 射阳县| 梁山县| 彭州市| 宜君县| 府谷县| 肥城市| 周宁县| 汝南县| 简阳市| 贵州省| 务川| 黔西县| 百色市| 江永县| 福建省| 河间市| 汶川县| 上栗县| 东光县| 安顺市| 桓仁| 揭西县| 怀远县| 曲麻莱县| 扶沟县| 灌云县| 府谷县| 葫芦岛市| 武安市|