How to configure nginx on Amazon Linux 2?

I am new to nginx and tried some tutorials to configure nginx on Amazon Linux 2. For a simple start I tried to show just another html page instead of the welcome page of nginx. The problem is thats no matter what changes I do in the nginx.conf file. Nothing change. The most confusing part is even if I stop nginx the welcome page is stil available. I started a new ec2-instance a moment ago and I did the following:

sudo amazon-linux-extras install nginx

sudo systemctl start nginx

Now the welcome page is available with the amazon url: ec2-.eu-central-1.compute.amazonaws.com.

sudo systemctl stop nginx

systemctl status shows that nginx is dead but the welcome page is still available. I am really confused, it seems didnt understand some fundamentals about nginx. Something similar happened if I change the nginx.conf file (for example I comment the complete server body out) and restart nginx. Nothing changed, the welcome page is still available…

best regards

sudo vim /etc/nginx/nginx.conf

Read more here: Source link