Question

When going to my server in the browser, it shows the CentOS welcome page instead of nginx. How can I fix that?

Posted December 31, 2019 988 views
NginxCentOS

I am running CentOS 7 on a droplet that I’ll be using as a web server. When I go to http://my_server_ip, it displays the “Welcome to CentOS” page.

I’ve followed the instructions to install, start, and enable nginx, but I still see the CentOS (not the nginx) welcome page.

Instructions from DO on installing nginx that I followed: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-debian-10

I also found that even when I turn off nginx, I still am able to get to that webpage, so it leads me to believe that this is interfering somehow.

I’ve also run the command “sudo netstat -tulpn” with the following result, but I don’t see anything listening on port 80, so I’m a bit confused:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1038/master         
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      27452/sshd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      1038/master         
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::22                   :::*                    LISTEN      27452/sshd          
udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd           
udp        0      0 10.10.0.5:123           0.0.0.0:*                           10653/ntpd          
udp        0      0 192.241.142.66:123      0.0.0.0:*                           10653/ntpd          
udp        0      0 127.0.0.1:123           0.0.0.0:*                           10653/ntpd          
udp        0      0 0.0.0.0:123             0.0.0.0:*                           10653/ntpd          
udp        0      0 0.0.0.0:698             0.0.0.0:*                           2643/rpcbind        
udp6       0      0 :::111                  :::*                                1/systemd           
udp6       0      0 fe80::585f:e3ff:fe7:123 :::*                                10653/ntpd          
udp6       0      0 ::1:123                 :::*                                10653/ntpd          
udp6       0      0 :::123                  :::*                                10653/ntpd          
udp6       0      0 :::698                  :::*                                2643/rpcbind 

How can I fix this?

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

Based on the netstat output that you’ve provided, I don’t see Nginx running on your server.

I’ve noticed that you’ve shared the article on how to install Nginx on Debian 10. I would recommend following the steps from this guide here on how to install Nginx on CentOS 7 here:

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7

Also, on another note, there are no services listening on port 80 you should not really see anything when visiting your IP address via HTTP. I could suggest two things:

  • Make sure that you are accessing the correct IP address
  • Make sure to clear the cache of your browser

Let me know how it goes!

Regards,
Bobby

by Mitchell Anicas
This articles covers how to install Nginx, a web server, on a CentOS 7 virtual server. This can be done with the CentOS package installer, yum.
  • My apologies. In my haste to get the post up, I included the wrong tutorial.

    I did actually follow the CentOS tutorial. I was just looking at the Debian tutorial because I noticed that they were a bit different.

    Just to be absolutely sure, I uninstalled and reinstalled nginx ($ sudo yum erase nginx then $ sudo yum install nginx) and started nginx up again.

    I then did as you suggested and cleared the cache for my browser. I still got the Welcome to CentOS page. Even tried a different browser, and I still got the same page.

    Here is what netstat returned this time:

    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1038/master         
    tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
    tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      18877/nginx: master 
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      27452/sshd          
    tcp6       0      0 ::1:25                  :::*                    LISTEN      1038/master         
    tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
    tcp6       0      0 :::80                   :::*                    LISTEN      18877/nginx: master 
    tcp6       0      0 :::22                   :::*                    LISTEN      27452/sshd          
    udp        0      0 0.0.0.0:111             0.0.0.0:*                           1/systemd           
    udp        0      0 10.10.0.5:123           0.0.0.0:*                           10653/ntpd          
    udp        0      0 192.241.142.66:123      0.0.0.0:*                           10653/ntpd          
    udp        0      0 127.0.0.1:123           0.0.0.0:*                           10653/ntpd          
    udp        0      0 0.0.0.0:123             0.0.0.0:*                           10653/ntpd          
    udp        0      0 0.0.0.0:698             0.0.0.0:*                           2643/rpcbind        
    udp6       0      0 :::111                  :::*                                1/systemd           
    udp6       0      0 fe80::585f:e3ff:fe7:123 :::*                                10653/ntpd          
    udp6       0      0 ::1:123                 :::*                                10653/ntpd          
    udp6       0      0 :::123                  :::*                                10653/ntpd          
    udp6       0      0 :::698                  :::*                                2643/rpcbind  
    
    edited by bobbyiliev
    • Hi @esquire,

      Thank you for the additional information.

      I can now see that Nginx is up and running and is correctly listening on port 80:

      tcp6       0      0 :::80                   :::*                    LISTEN      18877/nginx: master 
      

      I set up a new CentOS server and installed Nginx, it looks like that the default Nginx welcome page for CentOS has been changed so it is normal that you see the ‘Welcome to CentOS’ message.

      It is defined in this index file here:

      /usr/share/nginx/html/index.html
      

      I will submit a tutorial feedback and ask for the screenshot in the tutorial to be updated with the new one to prevent confusion! Thanks for pointing that out!

      Let me know if you have any other questions.

      Regards,
      Bobby

Submit an Answer