413 Request Entity Too Large AWS Elastic Beanstack

Viewed 811

I have uploaded springboot Rest APi over elastic beanstack, as a WAR file. Rest API is actually uploading file here is my code

@PostMapping(value = "/post")
@PreAuthorize("hasAuthority('WRITE')")
public ResponseEntity<?> createPost(@RequestParam String postData,
                                    @RequestPart(value = "attachments", required = false)
                                            MultipartFile attachments) {
    PostEntity postEntity = getPostEntity(postData);
    return new ResponseEntity<>(postService.createPost(postEntity, attachments), HttpStatus.CREATED);
}

its working fine in local enviroment, I am able to upload file up 50 MB (so for I tried). But after deploying on AWS cloud, its giving me Request Entity Too Large (413) error.

What Tried so far:

I created src/main/resources/.ebextensions/nginx/conf.d/proxy.conf file and inside that I have put

client_max_body_size 100M;

But it didn't work somehow.

I have also tried this approach:

If anyone has any suggestion please share suggestion here.

1 Answers
Related