Wordpress setup

mike mike503 at gmail.com
Thu Jul 3 21:49:51 MSD 2008


1) switch to using php-fpm for fastcgi management

2) try method #2 or even #3 here:

http://michaelshadle.com/2008/05/01/wordpress-nginx-rewrite-rules-stop-the-insanity/



server {
       listen 80;
       server_name blog.bsdguy.net;
       root /var/www/blog.bsdguy.net/wordpress/;
       index index.php;
       access_log /var/www/blog.bsdguy.net/log/access.log;
       if (!-e $request_filename) {
            rewrite ^(.+)$ /wordpress/index.php?q=$1 last;
      }
       location ~ \.php$ {
               include /usr/pkg/etc/nginx/fastcgi_params;
               fastcgi_pass  127.0.0.1:10000;
               fastcgi_index index.php;
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       }
}

that should get you started. i am having a minor issue with method #2
and method #3 on my blog where if you put /index.php at the end, it
isn't working. not sure why. i need to debug/ask more, but that should
get you started there...

that is the exact server block i have for my site and it works fine
(other than that minor annoyance which i need to fix, then i will
probably post a blog about the "final solution" since so many people
overcomplicate their rewrites for wordpress)

On 7/3/08, Francisco Valladolid <ficovh at gmail.com> wrote:
> Hi folks
>
> I'm setting wordpres 2.5 in a BSD box, running nginx 0.5.35, my basic
> php setup is :
>
> server {
>        listen 80;
>        server_name blog.bsdguy.net;
>        root /var/www/blog.bsdguy.net/wordpress;
>        index index.php;
>        access_log /var/www/blog.bsdguy.net/log/access.log;
>        if (!-e $request_filename) {
>                rewrite  ^(.*)$  /index.php?q=$1  last;
>                break;
>        }
>
>        location ~.*\.php?$ {
>                include /usr/pkg/etc/nginx/fastcgi_params;
>                fastcgi_pass  127.0.0.1:10000;
>                fastcgi_index /index.php;
>                fastcgi_param  SCRIPT_FILENAME
> /var/www/blog.bsdguy.net/wordpress$fastcgi_script_name;
>        }
> }
>
>
> before to init nginx I spawn de fcgi process with spawn-fcgi from lighttpd:
>
> % sudo /usr/pkg/bin/spawn-fcgi -u www -g www -a 127.0.0.1 -p 10000 -f
> /usr/pkg/libexec/cgi-bin/php -P /var/run/fastcgi-php
> spawn-fcgi.c.197: child spawned successfully: PID: 173
>
> nginx start with sucess, but when I try to open the web address it
> display  a window trying to open a file.
>
> I'm using NetBSD 4.0 stable, nginx 0.5.35, php5, whenever I belive
> this is no matter.
>
> Advices, tips, tricks, etc... are welcome .
>
> Regards.
>
> ficovh
>
> --
> Francisco Valladolid H.
>  -- http://bsdguy.net - Jesus Christ follower.
>
>





More information about the nginx mailing list