Nginx uses the client_max_body_size directive to limit how large a client's request body can be. When a client sends a request, nginx checks the size of the body. If the size is less than or equal to the configured limit, nginx processes the request normally. If the size is larger, nginx rejects the request and responds with a 413 Payload Too Large error. This prevents very large uploads or requests from overwhelming the server. The directive can be set in different configuration blocks like http, server, or location. For example, setting client_max_body_size 1m means requests with body size up to 1 megabyte are accepted. Requests larger than that are rejected immediately. This check happens before the request is fully processed, saving server resources.