I already enable nginx on Ubuntu 20.04, but nginx doesn't automatically start after reboot.
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 Sun 2022-01-23 07:33:50 WIB; 19s ago
Docs: man:nginx(8)
Process: 464 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
But I can start it manually.
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 Sun 2022-01-23 07:34:17 WIB; 2s ago
Docs: man:nginx(8)
Process: 891 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 901 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 902 (nginx)
Tasks: 2 (limit: 499)
Memory: 2.8M
CGroup: /system.slice/nginx.service
├─902 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─903 nginx: worker process
How can I auto start nginx everytime I restart??