I want to use two different domains with different IP addresses, for example
domain1.com - 12.34.56.78
domain2.com - 98.76.54.32
I am using nginx on Linux OS. What should I add in my nginx.conf?
I want to use two different domains with different IP addresses, for example
domain1.com - 12.34.56.78
domain2.com - 98.76.54.32
I am using nginx on Linux OS. What should I add in my nginx.conf?
You have to create two virtual hosts using server
block.
Let's suppose /var/www
contains domain1.com
and domain2.com
directories with whatever HTML pages, CGI scripts, ...
server {
listen 12.34.56.78:80;
server_name domain1.com
index index.html;
root /var/www/domain1.com
}
server {
listen 98.76.54.32:80;
server_name domain2.com;
index index.html;
root /var/www/domain2.com
}