简体   繁体   中英

Odd 404 issue with WordPress, Supercache, and nginx

My blog (raymondcamden.com) is using Wordpress, Supercache, and nginx. A user recently reported a link returning a 404: http://www.raymondcamden.com/2015/01/26/coldfusion-bloggers-migrated-to-node-js

I confirmed it and began digging. I went into my wp-admin and confirmed the entry still existed. I made a small mod, saved it, and confirmed it didn't throw an error, but the url still 404ed.

So I connected to the machine and dug around. I noticed in my wp-content/supercache folder that I did not have a 2015/01/26 subdirectory. That made me think permissions issues, but I've posted near 30 or so other blog entries since that date. I could see their directories just fine.

I found I had another blog entry from the same day. When I visited that, I saw supercache create the 26 folder (and the folder for the other blog entry of course).

Ok... so... it can't be permissions then. But I still can't see to figure out what it could be. I've looked at the error log and access log and do not see anything. I went to raymondcamden.com/thisisatest.php and immediately saw a 404 in the access log, but the same 404 for the blog entry above doesn't log.

Any ideas?

Turns out it was a caching setting. I had copied this from one of the tutorials:

location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
   access_log off; log_not_found off; expires max;
}

And the .js in the title seems to have messed with it. I noticed here ( http://codex.wordpress.org/Nginx ) that the regex is slightly different - and that probably will work better. (Going to try it now.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM