sudo nginx -t -c /etc/nginx/nginx.conf
1. it'll tell error logs
2. suspicious symbols left in sites-available or sites-enabled
to restart nginx-====
user@linux:/etc/nginx/sites-enabled$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since <date & time here >
Docs: man:nginx(8) Process: 5636 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
Process: 11109 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
Main PID: 16769 (code=exited, status=0/SUCCESS) <date & time here> linux systemd[1]: Starting A high performance web server and a reverse proxy server...
<date & time here> linux nginx[11109]: nginx: [warn] server name "(localhost/ip)" has suspicious symbols in /etc/nginx/sites-enabled/iomad:1
<date & time here> linux nginx[11109]: nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/sites-enabled/(your-website):2
<date & time here> linux nginx[11109]: nginx: configuration file /etc/nginx/nginx.conf test failed
<date & time here> linux systemd[1]: nginx.service: Control process exited, code=exited status=1
<date & time here> linux systemd[1]: nginx.service: Failed with result 'exit-code'.
<date & time here> linux systemd[1]: Failed to start A high performance web server and a reverse proxy server.
user@linux:/etc/nginx/sites-enabled$ systemctl start nginx
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units === Authentication is required to start 'nginx.service'. Authenticating as: server (user) Password: ==== AUTHENTICATION COMPLETE ===
Comments
Post a Comment