昊天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

分享到:更多 ()
a