昊天SEO

drupal 8 nginx rewrite规则

location = /favicon.ico {
    log_not_found off;
    access_log off;
  }
  
  location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
  }  
  
  location ~ \..*/.*\.php$ {
    return 403;
  }
  
  location ~ (^|/)\. {
    return 403;
  }
  
  location ~ ^/sites/.*/private/ {
    access_log off;
    deny all;
  }
  
  location / {
    try_files $uri @rewrite;
  }

  location @rewrite {
    rewrite ^ /index.php;
  }
  
  location ~ ^/(index|update)\.php(/|$) {
 fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
 fastcgi_split_path_info ^(.+\.php)(/.*)$;
 include fastcgi_params; 
 fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
 fastcgi_param DOCUMENT_ROOT $realpath_root;
        fastcgi_intercept_errors on;
  }
  
  location ~ ^/sites/.*/files/imagecache/ {
    try_files $uri @rewrite;
  }
  
  location ~ ^/sites/.*/files/styles/ {
    try_files $uri @rewrite;
  }

  location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires max;
    log_not_found off;
  }

未经允许不得转载:新乡seo|网站优化,网站建设—昊天博客 » drupal 8 nginx rewrite规则

网站的维护离不开大家的支持鼓励,捐赠让我更有动力走的更远&& 也可以关注我的微信公众号,发布更多的干货
本文网址:https://www.168seo.cn/jianzhan/drupal/1406.html

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

相关推荐