nginx WordPress URL rewrite

I’ve just installed nginx 1.0.8 and php-fpm and for the last 30 minutes I’m trying to rewrite the URL for WordPress.

Here is what the WordPress URL should look like:
http://localhost/website/blog/2011/10/sample-post/

Read More

I’ve looked at this tutorial: http://wiki.nginx.org/WordPress + many other on the web but every time I receive an 404 error (sometimes 403).

Here is what I did in my configuration file:

    location /website/blog {
            try_files $uri $uri/ /website/blog/index.php;
    }

    location ~ .php$ {
        root           html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors on;
        fastcgi_split_path_info ^(/website/blog)(/.*)$;
        include        fastcgi_params;
        error_page  404 /404.html;
    }

With this configuration I’m receiving “403 forbidden” status.

What am I missing?

Related posts

Leave a Reply

2 comments

  1. Could be the permission of the root site folder

    This is an example that i use to wordpress

    server {
    listen 80;
    server_name www.mysite.com mysite.com;
    root /srv/www/mysite.com/public_html;
    location / {
        index  index.html index.htm index.php;
        try_files $uri $uri/ /index.php?$args;
    }
     rewrite /wp-admin$ $scheme://$host$uri/ permanent;
     include /srv/www/mysite.com/public_html/*.conf;
     location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
    

    }