drupal 重写

ngnix重写规则

location ~ ^/sites/[^/]+/files/.*\.php$ {
    deny all;
} 
location ~* ^/.well-known/ {
    allow all;
} 
location ~ (^|/)\. {
    return 403;
}

location / { 
    try_files $uri /index.php?$query_string; 
}

location ~ /vendor/.*\.php$ {
    deny all;
    return 404;
}
location ~ ^/sites/.*/files/styles/ {
    try_files $uri /index.php?$query_string;
}

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