Nginx & Wordpress issues

May 23, 2013 4.6k views
Hello! I'm having a hard time with nginx & wordpress. Specifically I installed/configured WP on and all seems to be ok EXCEPT for the fact that in the wp-admin/ I can't see: Media, Posts return an "Invalid post type", there are no Pages (but in fact I have 2: Contact and About). Also, i would like to redirect to but i've got no idea how to make this work without any problems in nginx. Thank you in advance for helping out! Regards, Alex
7 Answers
Really? Nobody to help out?
I'd just start again dude, if you use the instructions in the articles and tutorials there is a step by step guide which is spot on!
by Etel Sverdlov
Wordpress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality. This tutorial shows how to install Wordpress on a server with LEMP (with nginx instead of apache). It is written for Ubuntu 12.04.
Oh and once you're done install memcache and the w3 total cache and it freakin' fly's!
The problem is that I need to install Wordpress in a folder /blog not in the root folder.

This is where Nginx gives me issues :)
@alex: I suggest you take a look at, especially the "WordPress Multisite Subdirectory rules" section.
@alex: Actually, try this first: - "Non-root try_files to URL redirect".
If that doesn't fix your problem, see my previous comment.
From what I've read elsewhere, this error "Invalid post type" can be caused by different things.
I found, however, that in my case it was caused by the line that the Nginx devs suggest inserting into your php block from

fastcgi_split_path_info ^(/wordpress)(/.*)$;

Commenting this line out and restarting nginx solved the issue. It also solved a problem that was racking my brain where I would get an error: "You are not authorized to view this page." while accessing certain Admin pages. The Nginx support page might be out of date.

I'm a total noob on regex and nginx blocks so I don;t fully understand what it was supposed to do in the first place.
Hope this helps.
Have another answer? Share your knowledge.