Skip to content

Instantly share code, notes, and snippets.

@tibezh
Created October 17, 2015 08:00
Show Gist options
  • Save tibezh/19eb7e5667a4ebc954ec to your computer and use it in GitHub Desktop.
Save tibezh/19eb7e5667a4ebc954ec to your computer and use it in GitHub Desktop.
Nginx Drupal Default conf
server {
listen 80;
server_name localhost;
root /var/www;
index index.php index.html;
client_max_body_size 200M;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
alias /usr/share/nginx/www/robots.txt;
log_not_found off;
access_log off;
}
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
deny all;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(\w*)/(.*)$ /$1/index.php?q=$2 last;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_read_timeout 300;
fastcgi_buffers 4 32M;
fastcgi_busy_buffers_size 64M;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment