Created
September 14, 2012 14:15
-
-
Save sanguis/3722160 to your computer and use it in GitHub Desktop.
drupal nginx config file for ubuntu 12.04 server
This file contains hidden or 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 { | |
server_name DOMAIN; | |
root /var/www/PATH; | |
index index.html index.htm index.php; | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
if (!-e $request_filename) { | |
rewrite ^/(.*)$ /index.php?q=$1 last; | |
} | |
error_page 404 index.php; | |
# hide protected files | |
location ~* .(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(.php)?|xtmpl)$|^(code-style.pl|Entries.*|Repository|Root|Tag|Template)$ { | |
deny all; | |
} | |
# hide backup_migrate files | |
location ~* ^/files/backup_migrate { | |
deny all; | |
} | |
# serve static files directly | |
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$ { | |
access_log off; | |
expires 30d; | |
} | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
include /etc/nginx/fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment