Solution of [errno 5] input / output error after Django is deployed on nginx

Knowledge map advanced must read: read how large-scale map data efficient storage and retrieval>>>

Environment: centos6.5 gunicorn + Django + nginx

After the configuration is completed and the project is running, the [errno 5] input/output error will be reported sometimes. At the beginning, print will report this error. After deletion, the same error will be reported in other places

my solution process and attempt are as follows:

1. The conf configuration file of nginx, and the path of configuration log

I saw an article mentioning this point, but he deployed it with uwsgi. The idea of the article is to suspect that there is no place for log files to go, which leads to IO errors. The solution is to increase log configuration
address http://shenwang.blog.ustc.edu.cn/freeshell%E4%B8%8A34218%E8%8A%82%E7%82%B9%E5%87%BA%E7%8E%B0django-errno-5-inputoutput-error/

According to this principle, I add log path configuration under the server node of nginx’s conf configuration file

access_log /home/webroot/www/public/XianyuApi/nginx.access.log;
​​​​​​​error_log /home/webroot/www/public/XianyuApi/nginx.error.log;

However, after setting this step, we restart nginx and gunicorn and find that they are the same. So I thought about the question of whether it would have authority

2. Set the access permission of the source code directory to 777
confirm the access permission of the source code folder, and recursively set the permission of all files to 777. When nginx is running, it is run by the user configured in nginx.conf, not by the user you are currently logged in to. Permissions can also lead to strange problems. This step must be confirmed at last. You may have set 777 at the beginning, but you may have added some configuration files to the directory in the middle, so check it at last< 3. Restart Dafa
but after this point is set, it will not work. After checking a lot of materials, in desperation, I restarted the Linux server. Then it’s ok…
you can also try to restart Dafa

as for which of the above steps led to the problem, I’m not sure. Anyway, I’ve done everything. If you encounter the same problem, you can try it step by step

Similar Posts: