luís saraiva
luís saraiva

Reputation: 1

DigitalOcean Nginx - Server not Found

I bought a domain and change the nameservers for the digitalocean's.

I went to https://whois.domaintools.com and the nameservers are correct.

However, when I go to my website with the domain, it appears server not found.

This is my Nginx configuration:

server {

    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;

    ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
    ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    
    root /var/www/html;


    index index.html index.htm index.nginx-debian.html;

    server_name domain.com www.domain.com;

    location ^~ /assets/ {
        gzip_static on;
        expires 12h;
        add_header Cache-Control public;
  }
    
    location /uploads  {
        alias /root/trendcircle/server/uploads;
        try_files $uri $uri/ =404;
        autoindex on;
    }

    location /api { 
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Access-Control-Allow-Origin '*';
        proxy_set_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
        proxy_set_header 'Access-Control-Allow-Headers' 'X-Requested-With, Accept, Content-Type, Origin, x-access-token';

        proxy_pass http://localhost:8080;       
    }
    
    location / {
        proxy_http_version 1.1;
        proxy_cache_bypass $http_upgrade;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_pass http://localhost:8081; 
    }
}

Can anybody help me? If you need more information just ask.

Thanks in advance!

Upvotes: 0

Views: 929

Answers (1)

NetSpud
NetSpud

Reputation: 67

Sounds like you need to check your A records. Digital Ocean provides a panel to route domains to specific droplets - but you'll need to add an A record pointing a domain to the droplet ip, too. Digital Ocean only forwards the request to the correct droplet once you're there.

Upvotes: 2

Related Questions