接口报错:Failed to load response data: No data found for resource with given identifier

1 Overview

Hello everyone, I am Ouyang Fangchao, you can follow my official account "Ouyang Fangchao", and the follow-up content will be published on the official account.
Viewing an interface through a browser returns the following results Failed to load response data: No data found for resource with given identifier:
insert image description here

2. Phenomena and solutions

2.1. Phenomena

Describe my phenomenon. This interface only has this problem in the online environment. This error is reported. Even if the gateway is enabled locally, there is no error. What is the difference between online and now? Even the database is the same. After a step-by-step investigation, it was found that the difference between online and offline is that nginx was used to request the interface online, so the problem may occur here. After searching, it was found that the return value of the interface was too large, and the default buffer of nginx was not enough to support it, resulting in nginx The returned information is truncated, and the size of the buffer needs to be set to solve this problem.

2.2. Solutions

Modify the configuration of nginx and add the following content to the location:

fastcgi_buffers 256 128k;
chunked_transfer_encoding off;

It should be noted that I added the above configuration in the location where the reverse proxy is used for the interface.
Restart nginx after adding.

After modification, even if the interface is requested through nginx, it should be accessed normally.

3. Summary

Although the problem is small, troubleshooting requires thinking.
I'm Ouyang Fangchao, and I'm interested in doing things well. If you like my article, please like, forward, comment and pay attention. See you next time.

Guess you like

Origin blog.csdn.net/u012288582/article/details/131663155
Recommended