nginx.service – A high performance web server and a reverse proxy server

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

Your server reported 502 error, checking nginx status reported error:

ubuntu@VM-0-13-ubuntu:/etc/nginx/sites-enabled$ service nginx status 
● 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 Wed 2020-02-26 00:26:39 CST; 4min 0s ago
     Docs: man:nginx(8)
  Process: 1853 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 26 00:26:39 VM-0-13-ubuntu nginx[1853]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/
Feb 26 00:26:39 VM-0-13-ubuntu nginx[1853]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: nginx.service: Failed with result 'exit-code'.
Feb 26 00:26:39 VM-0-13-ubuntu systemd[1]: Failed to start A high performance web server and a reverse proxy server.

Check a good meal has not found out why… First write it down, and then update it

—————————-Gorgeous dividing line————————

Why can’t we find out, because it’s a super primary mistake we made

ubuntu@VM-0-13-ubuntu:~$ sudo nginx -t
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/default:31
nginx: configuration file /etc/nginx/nginx.conf test failed

Check your configuration file, prompt that there is a problem on line 31, open it to see that you have written}

Add nginx after restart

ubuntu@VM-0-13-ubuntu:~$ sudo nginx -t
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/sites-enabled/default:31
nginx: configuration file /etc/nginx/nginx.conf test failed

Check the nginx status again to see if it is active

ubuntu@VM-0-13-ubuntu:~$ service nginx status
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-02-26 02:07:42 CST; 17s ago
     Docs: man:nginx(8)
  Process: 2765 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 2754 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 2769 (nginx)
    Tasks: 2 (limit: 2124)
   CGroup: /system.slice/nginx.service
           ├─2769 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─2772 nginx: worker process

Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 26 02:07:42 VM-0-13-ubuntu systemd[1]: Started A high performance web server and a reverse proxy server.

But it’s still 502, huh?Check it again and update it when you find it

Similar Posts: