current position:Home>The get request of nginx agent only returns part of the data. The problem is solved

The get request of nginx agent only returns part of the data. The problem is solved

2022-04-29 04:24:54gao_ grace

Problem description : The interface on the server sometimes has data , Sometimes there is no data , Through the analysis of , When you find a large amount of data ,get The data returned by the request is often only part of , No problem with other environments , It shouldn't be a code problem , Because the server uses nginx agent , The suspicion is nginx There's something wrong with the configuration
The screening process :

  1. Login server , Direct operation nginx command , Found that the command does not exist , So it runs ps -ef | grep nginx find nginx process , Find from nginx The specific path of the command , On my server nginx The path of is /usr/sbin/nginx
  2. function sudo /usr/sbin/nginx -t Locate the location of the configuration file , Here is /etc/nginx/nginx.conf
  3. Open profile , find error_log The location of , Check the error log
  4. Find the following information open() "/var/lib/nginx/tmp/proxy/7/02/0000000027" failed (13: Permission denied),
  5. The reasons are as follows : because get The amount of data obtained is too large ,nginx File cache used , then , Because you don't have permission to cache files , Cache failed , Data loss

resolvent : Check /var/lib/nginx/tmp route , Found that its owner is nginx, We changed the user in the configuration file , Cause no permission . modify /etc/nginx/nginx.conf, take user Change it to nginx, then reload that will do .

copyright notice
author[gao_ grace],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/118/202204280552145638.html

Random recommended