Esto es lo que trae cuando compruebas el estado de nginx
[root@ttproxyapp conf.d]# service nginx status Redirecting to /bin/systemctl status nginx.service ● nginx.service - nginx - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled) Active: inactive (dead)sudo systemctl stop apache2 sudo systemctl start nginxdebería funcionar ya que parece que el puerto está en uso (probablemente con apache)
tal vez haya un servidor apache ejecutándose. debe detener ese servidor apache para ejecutar el servidor Nginx.
sudo systemctl detener apache2
sudo systemctl iniciar nginx
Realmente parece que su NGINX no se está ejecutando. nginx -s reload solo funciona si hay una instancia en ejecución y, por lo tanto, un archivo PID.
Compruebe el resultado del siguiente comando.
[root@localhost conf.d]# sudo ps -elf | grep nginxdebería ser algo como
1 S root 88262 1 0 80 0 - 13143 sigsus 23:47 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf 5 S nginx 88263 88262 0 80 0 - 13257 ep_pol 23:47 ? 00:00:00 nginx: worker process 0 R root 88265 69227 0 80 0 - 28178 - 23:47 pts/1 00:00:00 grep --color=auto nginx¡Necesitas al menos! el proceso maestro y el proceso trabajador! Si no hay ningún proceso, inicie su instancia escribiendo
sudo /bin/systemctl start nginx.service O sudo service nginx start
Verifique su lista de procesos después de ejecutar el comando.
Después de haber iniciado el servicio NGINX, debería haber un archivo PID ubicado en /var/run/nginx.pid y sudo systemctl status nginx.service debería imprimir algo como
[root@localhost conf.d]# systemctl status nginx.service ● nginx.service - NGINX Plus - high performance web server Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2020-03-14 23:47:13 EDT; 5min ago Docs: https://www.nginx.com/resources/ Process: 88232 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 88260 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS) Process: 88251 ExecStartPre=/usr/libexec/nginx-plus/check-subscription (code=exited, status=0/SUCCESS) Main PID: 88262 (nginx) Tasks: 2 Memory: 1.7M CGroup: /system.slice/nginx.service ├─88262 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf └─88263 nginx: worker process Mar 14 23:47:13 localhost.localdomain systemd[1]: Starting NGINX Plus - high performance web server... Mar 14 23:47:13 localhost.localdomain systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory Mar 14 23:47:13 localhost.localdomain systemd[1]: Started NGINX Plus - high performance web server.Estoy ejecutando NGINX Plus pero no importa en este caso.