I'm working on a web application where users submit photos to an API that is running on AWS (Elastic Beanstalk). I'm seeing 413 (payload too large) responses when users try to submit photos that are > 2mb, which seems like it may be a result of Tomcat 8's default for maxPostSize.
So, I'm trying to figure out a way to modify this setting with the rest of the JVM options that we have pre-defined for each new EC2 instance that starts up with our auto-scaling. I've spoken with AWS support, and they recommended using EB extensions to set up a server.xml file with the needed configurations that gets copied over each time Elastic Beanstalk spins up a new server.
However, since all our other presets are configured with environment variables/JVM options in the Elastic Beanstalk configuration, I'd prefer to modify the Tomcat maxPostSize the same way, but I haven't been able to figure out the variable (if it's even possible) with java -D syntax. Is anyone able to point me in the right direction?
I really appreciate any advice or recommendations!
This error was happening in our test environment, and I realized that the AWS proxy server was actually running Nginx, rather than Tomcat (which it should have been all along). We switched back to Tomcat, and the problem was resolved. It appears that the issue may have been Nginx's default value for client_max_body_size.