Created
October 17, 2015 08:00
-
-
Save tibezh/19eb7e5667a4ebc954ec to your computer and use it in GitHub Desktop.
Nginx Drupal Default conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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