Skip to content

Instantly share code, notes, and snippets.

@rob-mcgrail
Created April 3, 2012 00:29
Show Gist options
  • Save rob-mcgrail/2288262 to your computer and use it in GitHub Desktop.
Save rob-mcgrail/2288262 to your computer and use it in GitHub Desktop.
Quick development drupal config for nginx
# /var/www/drupal/drupal-x.x/ all work with php-fastcgi
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
client_max_body_size 4G;
server_name _;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
# nginx so increasing this is generally safe...
keepalive_timeout 3;
# path for static files
root /var/www;
# Prefer to serve static files directly from nginx
# try_files $uri/index.html $uri.html $uri @your_app;
location / {
autoindex on;
}
location /drupal/drupal {
try_files $uri @drupal;
}
location @drupal {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment