D
D
Dmitry Morozov2017-07-08 21:49:04
linux
Dmitry Morozov, 2017-07-08 21:49:04

Website crashes sometimes + nginx throws an error every time you visit?

VPS with VestaCP panel. nginx + php fpm One site crashes 5-7 times a day, for a short time (up to 2 minutes). I can't understand why. Memory free 400mb +. During the fall, if you go to the site, it opens for about 30 seconds, after that, when updating, everything is as it should be - quickly and then the site is available.
Works through cloudflare in Flexible mode. When there was Full mode, it crashed even more often (once an hour, at about the same time) I
found it in the logs only on nginx


2017/07/08 21:34:04 [crit] 6843#6843: *4954 open() "/home/admin/web/SITE.ru/public_html/" failed (13: Permission denied), client: 89.153.25.28 , server: SITE.ru, request: "GET / HTTP/1.1", host: "www.SITE.ru"

NGINX config for domain
server {
   ....
   ....

    location / {

        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php?q=$1 last;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    127.0.0.1:9002;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }
    include     /home/admin/conf/web/nginx.site.ru.conf*;
}

in the php-fpm pool, the user and group are set correctly, as in the site directory/files.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2017-07-08
@sim3x

/home/admin/web/SITE.ru/public_html/" failed (13: Permission denied

4
4X_Pro, 2017-07-08
@XXXXPro

See if there is anything suspicious in cron (both under root and under the user on whose behalf the site is running), for example, a crooked script for backup.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question