• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

NGINX Reverse Proxy blocking uploads >1MB

Status
Not open for further replies.

thejimmyw

Chevereto Noob
The issue:
When uploading a simple screenshot with no embedded EXIF data, the upload works perfectly fine. Photo's with EXIF data fail resulting in a very generic Internal Server Error. I have debug_level set at 3 and php error reporting enabled. I have the setting to strip exif data turned on but changing this setting does not make a difference.

System:
Ubuntu 18.04.1 LTS
Apache 2.4.29
PHP 7.2.9-1+ubuntu18.04.1+deb.sury.org+1
MariaDB Ver 15.1 Distrib 10.1.29-MariaDB
Symlinked GlusterFS dir to $WEBROOT/images
PHP7.2-common installed along with PHP7.2-mbstring among other extensions.

Additional installation information available upon request.
cde2bbf1bb4375be38466d8818a7f35f.png
233c376405d324b7de9b80eaca1c7f73.png
 
Last edited:
Try to upload that image to the demo website where I've just enabled strip exif data

https://demo.chevereto.com

If you are able to upload the image to the demo then you have a local issue (only affects your installation). If the upload fails, the image could be corrupted or your gd isn't working properly.
 
Try to upload that image to the demo website where I've just enabled strip exif data

https://demo.chevereto.com

If you are able to upload the image to the demo then you have a local issue (only affects your installation). If the upload fails, the image could be corrupted or your gd isn't working properly.

Had to make an alternative test payload given the 2MB limit on the demo. Uploaded just fine to there, still fails on my install. Going to do some additional testing with different file formats to see if I can narrow the issue down.

EDIT: Seems to fail on anything > 1MB. 4.5MB original w/ EXIF fails. 4.3MB original w/o EXIF also fails. Compressed down to ~700KB w/o EXIF then works. Seems to be an issue with filesize but I can't deem why.

Converted to a ~800KB PNG from original JPG and uploaded fine. 1.1MB PNG failed. Definitely seems to be a limitation around the 1MB mark.
 
Last edited:
Creating a new post to share my solution.

Turns out I was being a bit of an idiot. I run all my web applications behind a NGINX reverse proxy for caching and security reasons. I completely failed to realise that NGINX by default has a 1MB client request limit. Images over this size were being rejected by the proxy but the 413 error sent by NGINX isn't properly handled so results in the 500 error. To fix this I simply needed to add
Code:
client_max_body_size 20m;
(or any other size required) to the config.

To MODs: This post can be locked now but the solution may be useful to others. Renaming topic to fit with my fix.
 
Status
Not open for further replies.
Back
Top