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?
"That's correct! App Engine offers NoSQL databases, in-memory caching, load balancing, health checks, logging, and user authentication to applications running in it." 1. Which of these criteria would make you choose App Engine Flexible Environment, rather than Standard Environment, for your application?
Customizable infrastructure - App Engine flexible environment instances are Compute Engine virtual machines, which means that you can take advantage of custom libraries, use SSH for debugging, and deploy your own Docker containers. Performance options - Take advantage of a wide array of CPU and memory configurations.
yaml file defines your configuration settings for your Python runtime as well as general app, network, and other resource settings.
# The standard nginx container just runs nginx. The configuration file added # below will be used by nginx. # Copy the nginx configuration file. This sets up the behavior of nginx. Most # important, it ensures that nginx listens on port 8080. Google App Engine expects # the runtime to respond to HTTP requests at port 8080.
The Hello World sample app also includes an nginx.conf file, which contains the basic nginx configuration information, as well was the index.html file, which serves as the root page for the nginx web server. Learn more about Dockerfiles at the Dockerfile reference.
Customizable infrastructure - App Engine flexible environment instances are Compute Engine virtual machines, which means that you can take advantage of custom libraries, use SSH for debugging, and deploy your own Docker containers. Performance options - Take advantage of a wide array of CPU and memory configurations.
Create an nginx-hosting folder and copy the dist folder into it. Add a Dockerfile file in the nginx-hosting folder, and copy the following code into the file: # The standard nginx container just runs nginx. The configuration file added # below will be used by nginx. # Copy the nginx configuration file. This sets up the behavior of nginx. Most
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With