Limit payload size using a reverse-proxy or a middleware

    1. http {
    2. # Limit the body size for ALL incoming requests to 1 MB
    3. }
    4. server {
    5. ...
    6. # Limit the body size for incoming requests to this specific server block to 1 MB
    7. location /upload {
    8. ...
    9. # Limit the body size for incoming requests to this route to 1 MB
    10. client_max_body_size 1m;
    11. }