I've installed nginx, FastCGI and PHP on my server. WordPress 3.0 installed after a bit of a monster battle, but it's installed and working well.
However, when I change the permalink settings to anything other than default, I get 404 errors on every post, article and page.
I understand that this is something to do with nginx not supporting .htaccess and WordPress getting confused with where to go when a page is requsted.
I've tried a few rewrites in the nginx conf files and even the nginx compatibility plugin; neither have worked. With one rewrite I managed to stop the 404 errors, but instead of WordPress finding the post I was after I merely got my PHP confirmation page. Bah.
Forums are littered with people with similar issues. Does anyone have a solution?
Adding this block to your nginx.conf should solve the issue:
Hope this helps.
Good luck.
On your location / block,
add this and remove any non-specific rewrite rules:
This was how I solved my permalinks in my wordpress blogs in dreamhost.
Inside the folder
/home/ftpusername/nginx/example.com/
(if you don't have it, create it)created the file nginx.conf with the following content
restarted the nginx
/etc/init.d/nginx reload
Some notes:
ftpusername and example.com MUST be changed according to your system.
That was it!
Good luck for u all.
Have you tried the nginx Compatibility plugin?
Plus ElasticDog seems to provide a fairly concise article on getting WP working with nginx - which includes getting pretty permalinks to work.
Here's another article that seems to deal specifically with nginx rewrite rules for WordPress.
After much pain:
If the requested file does not exist, pass it to index.php. It's a bit slow and I think I might try and not use a query, but it does work... :)
If wordpress is on another directory besides the root, instead of having
You can have:
This page has exactly the same concept. I should have read and tried it first: nginx rewrite rule under a subdirectory