Skip to content

Instantly share code, notes, and snippets.

@tibezh
Last active October 17, 2015 08:04
Show Gist options
  • Save tibezh/7c58e1f4eb80d19ac379 to your computer and use it in GitHub Desktop.
Save tibezh/7c58e1f4eb80d19ac379 to your computer and use it in GitHub Desktop.
Nginx drupal site conf
server {
listen 80;
server_name SITE.loc;
root /var/www/SITE;
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;
}
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location / {
try_files $uri @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.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