Intermittent 404s for Images (on Version 6.1.1)
-
I’m trying to upload images to multiple WordPress sites hosted on the same server with the same Docker Compose setup and wp-config.php settings. On one site, I can upload images with no problems, but on the other sites I’m hosting on this server, I can’t even view some images after they are uploaded.
I have a lot of experience with Linux and WordPress, but I’m struggling with a problem on a server that I’m hosting multiple WordPress sites on. Some images are consistently not loading and I’m getting a 404 error from nginx, but no other clear errors in the logs. I’ve checked file permissions and looked for any issues with .htaccess, but haven’t been able to find a solution. The strange thing is that this issue is only happening on four out of the five sites on the server, and the fifth one is working perfectly fine. I’ve done a thorough comparison of the four problematic sites and still can’t figure out what’s causing the issue.
One strange thing: For the broken images, thumbnails aren’t showing up but I can view and edit the image (rotate, etc) but even after saving, still can’t view it.
I’ve checked the permissions, file size, and file type, and they all seem to be the same as the site where the images are working. I’m just getting 404 errors.
To duplicate:
upload two images from PC cat and butterfly:
-rw-r--r-- 1 www-data www-data 93K Dec 26 21:05 anne_cute_cat.jpg -rw-r--r-- 1 www-data www-data 77K Dec 26 07:44 butterfly-icon.jpg "GET /wp-content/uploads/2022/12/anne_cute_cat.jpg HTTP/2.0" 404 548 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" "-" and "GET /wp-content/uploads/2022/12/butterfly-icon.jpg HTTP/2.0" 200 78841 "-" "curl/7.74.0" "-"
I know I used webkit and curl, but the effect is the same from any request method.
this is true of any jpeg that I save from photoshop. I’ve tried various upload methods such as SCP and I’m pretty sure it’s something with the encoding or headers. I also get 404’s for all PNGs.
comprehensive site info here: https://gist.github.com/tbbooher/8423951a70326b53c4eb16e2c85ab8e9
the site is created by docker-compose with the nginx.conf here: https://gist.github.com/285a545fd1ea4d5231a2eaa1a6ae673f
- The topic ‘Intermittent 404s for Images (on Version 6.1.1)’ is closed to new replies.