Report this

What is the reason for this report?

Domain names are indifferent

Posted on August 20, 2015

Hello,

I have followed this post and tried to make two domains work on a single server.

To make thing simpler, I don’t want to set up a default server.

/etc/nginx/sites-available/addbba.com

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

        root /var/www/addbba.com/html;
        index index.php index.html index.htm;

        server_name addbba.com www.addbba.com;

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

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

/etc/nginx/sites-available/matrixandcompany.com

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

        root /var/www/matrixandcompany.com/html;
        index index.php index.html index.htm;

        server_name matrixandcompany.com www.matrixandcompany.com;

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

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

I bought two domains addbba.com and matrixandcompany.com both from GoDaddy, I made them forward and mask to the IP 178.62.87.72 that I bought from DigitalOcean.

The result of the above configuration is that, the two URLs and 178.62.87.72 all lead to the same page of addbba.com.

If I delete the /etc/nginx/sites-enabled/addbba.com and leave only /etc/nginx/sites-enabled/matrixandcompany.com, the two URLs and 178.62.87.72 all lead to the same page of matrixandcompany.com.

So it seems that the URL is not well parsed and does not make any difference. Did I set something wrong in GoDaddy (maybe DNS?), or in nginx?

Thank you

The developer cloud

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

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.