Q:

nginx server block shows welcome page

I'm trying to set my rails app to a specific subdomain.
I'm using an ec2 instance with a bitnami rubystack VM
I developed the app using it with the ip of the server, so I know that rails and the app work.
${nginx-dir}/conf/nginx.conf 
server {
listen       80 default_server;
server_name  _;
server_name_in_redirect off;
proxy_intercept_errors on;
return 401;
}
include "/opt/bitnami/nginx/conf/vhosts/*.conf";

${nginx-dir}/conf/vhosts/backend.conf
upstream thin_instances {
   server 0.0.0.0:3000;
   server 0.0.0.0:3001;
   server 0.0.0.0:3002;
   fair;
}
 server {
    # port to listen on. Can also be set to an IP:PORT
    listen 80;
    server_name backend.mydomain.com;
      root /opt/bitnami/projects/myappname/public;
    location / {

      proxy_pass http://thin_instances;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      if (!-f $request_filename) {
        proxy_pass http://thin_instances;
      break;
      }
     }
}

This is what I get when I do a post or get request to the domain
<html>
<head><title>401 Authorization Required</title></head>
<body bgcolor="white">
<center><h1>401 Authorization Required</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>

A:

Two things to be aware of:

The server block in nginx.conf supersedes your custom server definition, since that is presumably being used before the custom configs are included (the first server section that matches the Host header, since it is a wildcard here, will be the configuration that is used, unless you set server_name ""). Since document_root isn't set in the default server block, it will default to something like /var/www which may not be what you want.
Keep in mind the default nginx configuration in most distros is probably including all the .conf files from /etc/nginx/sites-enabled. You'll probably want to create a symlink in that directory to the .conf file in /etc/nginx/sites-available. (If you removed everything else from nginx.conf e.g. your listing is the contents verbatim of nginx.conf, you'll probably want something like include /etc/nginx/sites-enabled/*; at the end.

A:

I have to remark that the answer provided by blackbox222 help me to determine the root of the problem. Finally, I changed my DNS provider for one that could actually configure the A record properly and not use some sort of bizarre redirect.
TL;DR: make sure your DNS is configured properly

