Answer the question
In order to leave comments, you need to log in
Why don't Nginx+PHP-FPM work after aptitude upgrade?
I have a server to learn how to administer a little on it. I didn’t go there for two months and decided to do aptitude upgrade yesterday because of nothing to do. After that, the hosts no longer work, I did not find anything in the nginx, php and syslog logs. If the php service is stopped, then nginx issues 502.
nginx - 1.8
php-fpm - 5.6
nginx config:
server{
listen 80;
server_name telesovet.litravechera.ru;
root /var/www/telesovet;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
}
Answer the question
In order to leave comments, you need to log in
Found what the problem is. Thanks everyone for the replies. The problem turned out to be in the nginx config, or rather, in the listen parameter.
Extract from documentation:
There were other configs, and they just have "listen ip: port" and it turns out that listen is more important than an exact match with server_name. So you need to be careful, and don't use listen just like that.
Thanks again.
PS Although it's still strange why everything broke after the update.
In nginx 1.8, some directive has become mandatory for specifying in the location block that sends a request to php, but I don’t remember which one, just look at the config examples specifically for 1.8.
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question