At first, I thought it was a cross-domain problem, but it turned out to be 413

The problem occurred in the development of docking, the picture sent to me by the front end at the beginning

 With trivial experience, I thought it was a cross-domain problem when I saw the above. I didn't see the status code 413 below.

Then I couldn’t figure it out, and the cross-domain processing was also done, why did a single interface have a cross-domain problem………

Then I asked the front end for the request header and response header (in fact, mainly to see the source address), and found that

Isn't it obvious that the request body is too large.

Then I went to find the configuration and found that the maximum size of the file set by the servlet is not small (in fact, if there is a problem with the servlet configuration, I should return 500 instead of 413) , so I turned to nginx configuration. At first glance, there is no configuration, so I checked and found that the nginx configuration upload file size is 1m by default , and then added the nginx configuration, and added client_max_body_size 100000000 ( joke value ) m to http{} ; after restarting nginx, there was no Pabu Ram.

Only then did I notice the status code 413. I'm sorry.

413 of HTTP status code – request entity too large (Request entity too large)

Continue to accumulate development experience~~

Guess you like

Origin blog.csdn.net/wai_58934/article/details/126808065