413 NGINX error on large file uploads

867 views
Skip to first unread message

Scott Campbell

unread,
Oct 31, 2017, 9:01:20 AM10/31/17
to Google App Engine
Hey Everyone,

Hoping to get some help, as there doesn't seem to be much support in the Google docs regards the NGINX configuration when running an app in Google App Engine.

My app is running fine, but I get this 413 error when I try and upload an audio file (.wav or .mp3).

"413 Request Entity Too Large -- nginx "


My app is running Django, with Cloud PostSQL and Cloud Storage enabled.


I researched the error, and it seems I can set an NGINX config setting "client_max_body_size 20M" but like I said, there is no documentation regaring how to manually config NGINX on deploy.

Does anybody have any idea what is going on?  Any suggestions?

Yannick (Cloud Platform Support)

unread,
Oct 31, 2017, 3:32:05 PM10/31/17
to Google App Engine
Hello Scott, an App Engine application cannot receive inbound requests that are larger than 32MB. This limit cannot be increased.

In order to store large files, you should instead upload them directly to Cloud Storage. Resumable uploads are a good way to handle the upload of large files.

Scott Campbell

unread,
Oct 31, 2017, 7:16:46 PM10/31/17
to Google App Engine
Hey Yannick,

Thanks for your input.

In the case that I need to upload files that are larger than 32 MB, what are my options?  I was hoping to upload to cloud storage using my app.  It was the reason I built it haha.

Yannick (Cloud Platform Support)

unread,
Nov 1, 2017, 4:40:47 PM11/1/17
to Google App Engine
The way to circumvent App Engine's 32MB limit is to send the requests directly to Cloud Storage, for instance using the resumable upload process. You can still use App Engine to serve your app, but the clientside portion of the app would be the one handling the upload to Google Cloud Storage. For this you would have your application generate a signed URL which the client can use to gain access to your Cloud Storage bucket for the purpose of uploading an image
Reply all
Reply to author
Forward
0 new messages