Report this

What is the reason for this report?

Domain not working with nginx server setup

Posted on April 17, 2020

Hello,

I followed every steps from tutorial https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04#step-3-–-checking-your-web-server

I added dns to my domain provider,

  • ping to mydomain.com working
  • connecting to server using server ip from above tutorial working
  • added ufw rules But, when I type mydomain.com in chrome or firefox, it is just not responding at all. Could anyone help me to figure out what is the problem?


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

I have the same issue my domain reply but not open the web page , my setup is nginx and mariadb and wordpress any help please

Hi @choipaper,

There are a couple of things you’ll need to check. Make sure you have created a configuration file for your domain mydomain.com in the /etc/nginx/sites-available/mydomain.com.

In there make sure you have the proper server block like so

server {
        listen 80;
        listen [::]:80;

        root /var/www/mydomain.com/html;
        index index.html index.htm index.nginx-debian.html;

        server_name mydomain.com www.mydomain.com;

        location / {
                try_files $uri $uri/ =404;
        }
}

Notice that you’ll need to change

        root /var/www/mydomain.com/html;

and

        server_name mydomain.com www.mydomain.com;

To the proper path and domain respectfully.

Once you have updated your configuration file, make sure to run

sudo ln -s /etc/nginx/sites-available/mydomain.com /etc/nginx/sites-enabled/

Again, remember to change your mydomain.com with the actual domain.

Lastly, check your Nginx configuration with

sudo nginx -t

If everything is okay restart nginx and everything should start working

service nginx restart

Regards, KDSys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.