问题
I have domain my-domain.com, I want to setup (DNS) sub domains to point to my 'PUBLIC IP' where my website is hosted
Currently I have this, setup in DNS:
--------------------------------------------------------------
| Domain | Type | Content |
==============================================================
| www.my-domain.com | A | 'PUBLIC IP' |
--------------------------------------------------------------
and in my website host box, I setup one nginx server block point to my main website 'www.my-domain.com'
server {
listen 80;
server_name www.my-domain.com
location / {
proxy_pass http://127.0.0.1:8080
}
}
Now I want to run another website in the same box and i want it to be accessible using blogs.my-domain.com. With this, I'm going to setup another nginx server block as :
server {
listen 80;
server_name blogs.my-domain.com
location / {
proxy_pass http://127.0.0.1:8081
}
}
How do i configure blogs.my-domain.com DNS Entry?
Thanks in advance for the help.
回答1:
You can create it as a CNAME record:
blogs.my-domain.com CNAME www.my-domain.com
Note that with some DNS software the above won't work because it is using relative domains, i.e. they don't terminate in a .
.
来源:https://stackoverflow.com/questions/18245213/dns-configuration-for-domains-and-subdomains-to-point-to-single-ip