• 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

    • This topic was modified 2 years, 2 months ago by timothybooher. Reason: clarity
    • This topic was modified 2 years, 2 months ago by timothybooher.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator t-p

    (@t-p)

    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.

    Exactly same plugins/theme on both sites?

    If not, to rule out a plugin or theme conflict, please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    _____

    If you can install plugins, install and activate “Health Check”: https://www.ads-software.com/plugins/health-check/
    It will add some additional features under the menu item under Tools > Site Health.
    On its troubleshooting tab, you can Enable Troubleshooting Mode. This will disable all plugins, switch to a standard WordPress theme (if available), allow you to turn your plugins on and off and switch between themes, without affecting normal visitors to your site. This allows you to test for various compatibility issues.
    There’s a more detailed description about how to use the Health Check plugin and its Troubleshooting Mode at https://make.www.ads-software.com/support/handbook/appendix/troubleshooting-using-the-health-check/

    Thread Starter timothybooher

    (@timothybooher)

    Yes. exactly the same. both with troubleshooting on and off produces the same outcome.

    Thread Starter timothybooher

    (@timothybooher)

    I’m at a total loss here. I don’t have any information from the logs other that the images are serving a 404.

    I would love some troubleshooting tips.

    Moderator t-p

    (@t-p)

    Try asking your hosting provider tech if there is any limitation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Intermittent 404s for Images (on Version 6.1.1)’ is closed to new replies.