title: NGINX failed to work while configuring server for subdomain
body: <p>Job for nginx.service failed because the control process exited with error code.
  See &quot;systemctl status nginx.service&quot; and &quot;journalctl -xe&quot; for details.</p>
  <p>Prior to this prompt, the server was working fine, but when I tried to config the server for subdomain it failed to work with this error.</p>
  <p>Also for detailed error ...</p>
  <pre><code>[ec2-user@ip--------- conf.d]$ systemctl status nginx.service
  
  ? nginx.service - The nginx HTTP and reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2020-07-07 06:03:04 UTC; 4min 17s ago
    Process: 71445 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
    Process: 71444 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
   Main PID: 70298 (code=exited, status=0/SUCCESS)
  
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal systemd[1]: Starting The nginx HTTP and reverse proxy serv&gt;
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal nginx[71445]: nginx: [emerg] unexpected end of file, expec&gt;
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal nginx[71445]: nginx: configuration file /etc/nginx/nginx.c&gt;
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal systemd[1]: nginx.service: Control process exited, code=ex&gt;
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal systemd[1]: nginx.service: Failed with result 'exit-code'.
  Jul 07 06:03:04 ip-999.ap-south-1.compute.internal systemd[1]: Failed to start The nginx HTTP and reverse pro&gt;
  lines 1-13/13 (END)
  </code></pre>