The problem is this: I am accustomed to add "wp-admin" directly behind the blog address to enter the WordPress backstage, but in the future found no matter what I point to any of the management subkeys, all 404 (Can not find the page), the moment I was embarrassed, this is God horse condition ...
Carefully looked at the link to manage the child, found that they are all similar to "//www.jb51.net/blog/edit.php" such, the key is that they are less "/wp-admin/" This path, the path is wrong, affirmation 404 Bai ...
Know the problem is simple, and the answer is definitely still in Nginx redirect rules, but I do not know how to change, but I also know that the official WordPress must have been solved, so I still very calm to check the document ... Got it
Http://codex.wordpress.org/Nginx
# Add trailing Slash to */wp-admin requests.
rewrite/wp-admin$ $scheme://$host $uri/permanent;
Sure enough, I found the solution on the Codex, simply adding a line of slash redirection, and the methods are summarized as follows:
1, Login Shell,vim edit nginx configuration directory (usually in/usr/local/nginx/conf/) under the "wordpress.conf", of course, if you like me to write the Conf file, Then change the corresponding redirect configuration file.
Vim/usr/local/nginx/conf/wordpress.conf
2, the official to the line added to the end of the document on the line
location/blog/{
if ($host!= ' www.jb51.net ') {
rewrite ^/(. *) $//www.jb51.net/$1 permanent;
}
if (-f $request _filename/index.html) {
rewrite (. *) $1/index.html break
;
if (f $request _filename/index.php) {
rewrite (. *) $1/index.php;
}
if (!-f $request _filename) {
rewrite (. *)/blog/index.php;
}
}
rewrite/wp-admin$ $scheme://$host $uri/permanent;
3.: Wq Save Restart Nginx
In fact, if you are lazy, directly with "Echo >>" append on the line = =
PS: It is said that Nginx will not automatically at the end of the request plus a slash, will not automatically determine whether the request is a file or a directory. Searching the Nginx slash on the web will refer to the need to add this slash at the end of the request.
The information on the Internet is written like this:
After the index index.html of the location/{} in nginx\conf\vhost.conf, add
if (-D $request _filename) {
rewrite ^/(. *) ([^/]) $ http://$host/$1$2/permanent;
}
But if you have a port on the back of your Web site, there will be a 403 error when turning.
That is $host variable to lose the port, change to $http _host variable can
All problems are solved by changing the following wording
if (-D $request _filename) {
rewrite ^/(. *) ([^/]) $ http://$http _host/$1$2/permanent;
}