Nginx, Drupal 7

Il file di configurazione per Drupal 7 (non usato): /etc/nginx/drupal7.conf

 

location /d7 {
  try_files $uri @rewrite;
}

location @rewrite {
  rewrite ^ /index.php;
}

#location = /favicon.ico {
#  log_not_found off;
#  access_log off;
#}

#location = /robots.txt {
#  allow all;
#  log_not_found off;
#  access_log off;
#}

location ~* \.(txt|log)$ {
  allow 192.168.2.0/24;
  deny all;
}

location ~ \..*/.\.php$ {
  return 403;
}

location ~ ^/sites/.*/private/ {
  return 403;
}

location ~ (^|/)\. {
  return 403;
}
location ~ /d7/.+\.php$ {
  try_files $uri =404;
  fastcgi_pass   unix:/var/run/php5-fpm.sock;
  fastcgi_index  index.php;
  fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include /etc/nginx/fastcgi_params;
  fastcgi_param  QUERY_STRING     $query_string;
  fastcgi_param  REQUEST_METHOD   $request_method;
  fastcgi_param  CONTENT_TYPE     $content_type;
  fastcgi_param  CONTENT_LENGTH   $content_length;
  fastcgi_intercept_errors        on;
  fastcgi_ignore_client_abort     off;
  fastcgi_connect_timeout 60;
  fastcgi_send_timeout 180;
  fastcgi_read_timeout 180;
  fastcgi_buffer_size 128k;
  fastcgi_buffers 4 256k;
  fastcgi_busy_buffers_size 256k;
  fastcgi_temp_file_write_size 256k;
}

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

# Block access to .htaccess files
location ~ /\.ht {
  deny all;
}