Big Data to Tomcat Behind Nginx
Everything works well until some big changes got in – it stopped working sometimes and the pattern is not quite consistent. Initially I thought it was because of long time processing at the server side.
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
It turned out it’s not the case later when I have more to look into it later. From the browser console in developer tools, I found the following print out.
Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)
It’s clear that the server rejected the big data. Because my tomcat server runs behind Nginx, it’s not clear which server caused it. A quick look at the tomcat access log showed that there is no URL for the server. So it’s most like that Nginx caused the problem.
With that in mind, a quick Internet search with keyword with Nginx and above error message got me many articles. The solution is actually quite simple: add the following line inside the server section in the /etc/nginx/nginx.conf file as follows:
Now the Nginx will allow 10M in the request body – a limit that is good enough for my task.
With the change of configuration, the Nginx server must be restarted using the following the command:
# systemctl restart nginx