root@ubuntu:/usr/local/nginx/sbin# nginx -t
The program 'nginx' can be found in the following packages:
* nginx-core
* nginx-extras
* nginx-full
* nginx-light
Try: apt install <selected package>
原因 :软件安装有问题,编译不对。
解决办法:
方法一、使用绝对路径
root@ubuntu:/usr/local/nginx/sbin# sudo /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
方法二、(