0

I am setting up my ec2 machine on AWS and when I change server_name from x.xxx.xx.xxx to ec2-x-xxx-xx-xxx.eu-central-1.compute.amazonaws.com, and run sudo service nginx restart it gives me

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

The nginx sites-enabled file

  server {
    listen 80;
    server_name ec2-xx-xxx-xxx-xxx.eu-central-1.compute.amazonaws.com;
    access_log  /var/log/nginx/example.log;

    location / {
        proxy_pass http://127.0.0.1:8000;
    }
  }

What can I try to resolve this?

bd_28
  • 125
  • 10
  • Try configuration test via `nginx -t` command. Check the error log, by default `/var/log/nginx/error.log`. Update the post and add more information if you cannot solve the problem. – qwsj May 03 '21 at 17:09
  • What is output of systemctl status nginx.service – RomkaLTU May 03 '21 at 21:18
  • if the problem appeared only after updating `server_name`, maybe you forgot to put the `;` at the end? – qwsj May 04 '21 at 09:00
  • @qwsj no, there is no typos I checked that 100 times – bd_28 May 04 '21 at 15:00
  • The answer to this question is here: https://stackoverflow.com/questions/13895933/nginx-emerg-could-not-build-the-server-names-hash-you-should-increase-server – bd_28 May 04 '21 at 16:51

0 Answers0