Drupal on nginx
August 15th, 2010
No comments
virtualhost nginx config file and a localtion
server ~/ $ cat /etc/nginx/sites-available/default.conf server { listen 80 default; server_name _; access_log /var/log/nginx/localhost.access.log; server_name_in_redirect off; root /var/www/; index index.php; location / { root /var/www/; index index.php index.html index.htm; if (!-e $request_filename) { # if the file does not exist rewrite ^/(.*)$ /index.php?q=$1 last; break; } } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } }
What do you need for this? 1st the php-cgi installed. To check where it is use
server ~/ : which php-cgi /usr/bin/php-cgi