Nginx, VPS, Mediawiki, short url = need fastcgi location

software development

#1

I am attempting to switch over from Apache to Nginx on a Dreamhost PS but my website uses MediaWiki software and I already implented short url rewrite in this form = http://website.com/article_title . I know Nginx doesn’t have htaccess but I found this instruction on MediaWiki for short url with Nginx in the short url format I am using :
[php]
server {
server_name www.example.com example.com;
listen 80;

root /home/user/example.com;
index  index.php index.html index.htm;

access_log  /var/log/nginx/access-example.log;
error_log /var/log/nginx/error-example.log;

location ~ \.htaccess {
            deny all;
    }

location / {
	if (!-e $request_filename) {
		rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
	}
	if ($uri ~* "\.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$") {
		expires max;
		break;
	}
}

location ~* \.php$ {
	if (!-e $request_filename) {
		return 404;
    	}

    	include /etc/nginx/fastcgi_params;

        fastcgi_pass  127.0.0.1:9000;
    	fastcgi_index index.php;

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;		
}

}
[/php]

but when I enabled nginx my website would not load. I belive the “include /etc/nginx/fastcgi_params;” is incorrect - could someone tell me the correct location for fastcgi in a dreamhost vps and also if the location for the access and error log is correct?

My level of competence is shaky as a web admin so be gently. Thanks!


#2

The standard nginx config is pushed to /dh/nginx/servers/httpd-/nginx.conf, and contains all the standard stuff FastCGI needs to work. You should be able to build off that configuration, rather than writing your own.