Cannot setup multiple domains


#1

Hi,

I am trying to setup multiple domains for my website on local machine. Following is the server block.

server {
server_name upsite.com www.upsite.com upsite.de www.upsite.de;


access_log /var/log/nginx/upsite.com.access.log rt_cache;
error_log /var/log/nginx/upsite.com.error.log;


root /var/www/upsite.com/htdocs;



index index.php index.html index.htm;


include common/php.conf;

include common/wpcommon.conf;
include common/locations.conf;
include /var/www/upsite.com/conf/nginx/*.conf;

}

I added additional domains to server_name and I restarted ee stack.

When I run

ping upsite.de

It does not show local IP address 127.0.0.1, even when I open upsite.de in browser, it gets redirected to some other site.

Can anyone please guide me what should be the issue? I am using latest version of easyengine.

Regards


#2

@ankitrox

You need to point dns entry in your /etc/hosts file like this

127.0.0.1 upsite.de


#3

a quick question about this should we be using 127.0.0.1 or the ip of our server?


#4

In /etc/hosts you use 127.0.0.1.

In DNS you use your public IP.


#5

hey there @janiosarmento is this a MUST?

i mean, do we HAVE to add te entry into the hosts file?


#6

In an ideal world you’d never touch /etc/hosts. But sometimes we need use it, specially during slow DNS propagation cases.


#7

ahhhh so the purpose of editing the hosts file is to stop the system looking externally and connecting to localhost…

awesomes


#8