Nginx error debugging an example
Nginx logs are divided into main process logs and child process logs. The main process is the Nginx process and the child process is the worker process. To debug errors, it is best to turn on the child process log.
When you deploy FastdFS today, you can upload images and receive HTTP 400 errors when accessing images. An HTTP400 error is a server process problem.
Curl -v = curl -v = curl -v = curl -v = curl -v That’s right. The program is hanging.
What’s the problem? Open the child process log at this point:
vim nginx_fastdfs_storage.conf
server {
listen 8888;
server_name localhost;
access_log logs/access.log main; ## Open log
location ~* /(? :app|accsett)/M00/(.+)? _width([0-9]+)? _height([0-9]+)? _networkType(.+)? .(jpg|jpeg|gif|png|webp) {
Omit...Copy the code
}
location ~/(app|accsett)/M00 {
ngx_fastdfs_module;
Copy the code
}
If relative electron has more intuitive understanding, it can also refer to its format as follows:
www.pizei.com
location = /50x.html {
root html;
Copy the code
}}
Curl -v = curl -v = curl -v = curl -v = curl -v At the same time, the page game background error:
ERROR – file: .. /common/fdfs_http_shared.c, line: 153, param “http.mime_types_filename” not exist or is empty
The work process crashed, causing a hang error. Since there is an error log, it is easy to do, Baidu search solved. The main display is the debugging process of Nginx