I just upgraded my ubunut server on AWS to Ubuntu 20.04.1 LT from Ubuntu 16.x
I had some issues upgrading at first, but I was able to move past those. Once I upgraded though I could not get nginx to run and actually use my website again.
After looking at my nginx.conf and errors this line was causing an error:
nclude /etc/nginx/sites-enabled/*;
There was the example file in the sites-enabled along with my actual websites file so I changed it to:
include /etc/nginx/sites-enabled/mywebsite.net;
Once I made that issue, I was able to get nginx to start and run but when I tried to view my website I got a 502 error.
While looking at the logs I was able to pull this line:
2020/11/25 15:27:02 [crit] 12327#12327: *1 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: xx.xx.xx.xx, server: www.mywebsite.net, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "www.mywebsite.net"
So I went back into my /sites-enabled/mywebsite.net
file and I believe this is what the issue is, for not pointing to the right place for php:
location ~ .php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
But I am not sure what to do for next step to get it pointing to the right location for php?