WordPress mit nginx und php-fcgi

July 18, 2011 admin nginx

Folgende Nginx Konfiguration verwende ich für WordPress.
Verwendet wird PHP-FCGI was auf Port 9000 laufen muss.
Wichtig ist der Teil unter “this sends all non-existing file or directory requests to index.php”

server {
	listen 80;
	server_name  www.domain.de domain.de;

	access_log  /var/log/nginx/domain.de.log;

	location / {

		root   /var/www/domain.de;
		index index.php index.html index.htm;

	        # this sends all non-existing file or directory requests to index.php
        	if (!-e $request_filename) {
       		     rewrite ^(.+)$ /index.php?q=$1 last;
        	}

	}

	error_page   500 502 503 504  /50x.html;
	location = /50x.html {
		root   /var/www/;
	}

	location ~ \.php$ {
		fastcgi_pass   127.0.0.1:9000;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  /var/www/domain.de/$fastcgi_script_name;
		include	       fastcgi_params;
	}

}

Hier noch 2 Links, die andere Ansätze verfolgen als ich:
http://suckup.de/2010/08/30/nginx-wordpress/
http://www.lordmat.de/2010/03/wordpress-mit-nginx/

No related posts.

nginx, php-fcgi, wordpress,

2 Responses to “WordPress mit nginx und php-fcgi”


Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress. Designed by elogi.