scottc11
scottc11

Reputation: 916

How can I edit the NGINX configuration on Google App Engine flexible environment?

How can I edit the Google App Engine NGINX configuration?

There doesn't seem to be much support in the Google docs in regards to the NGINX configuration for apps running in the Google App Engine flexible environment.

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 (python 3), with Cloud Postgres SQL and Cloud Storage enabled.

I researched the error, and it seems I can set a nginx.config file so that it includes "client_max_body_size 80M" - but like I said, there is no documentation regarding how to manually config NGINX on deploy.

Any suggestions?

Upvotes: 11

Views: 12371

Answers (2)

scottc11
scottc11

Reputation: 916

So upon contacting Google Support, the suggested solution for uploading files larger than 32MB is as follows:

"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."

I went with this solution. It saves money in the end.

Upvotes: 2

dwelling
dwelling

Reputation: 491

You should be able to create a nginx-app.conf file in the same directory as your app.yaml file. There is an example of using the nginx configuration file in a Flex environment located here: https://github.com/GoogleCloudPlatform/getting-started-php/tree/master/4-auth .

This same file is referenced in Google's documentation here: https://cloud.google.com/appengine/docs/flexible/php/runtime#customizing_nginx

Once you have that file created, you should be able to add any property you need and then rebuild your project to see the changes take effect.

Upvotes: 16

Related Questions