Why did it always show my domain's webpage when I enter my subdomain's address?

余生长醉 提交于 2019-12-25 06:59:49

问题


I have a domain - kongming.io. I want to create a link on the main page of kongming.io which links to the subdomain song.kongming.io. But when I click that button or type song.kongming.io directly in the explorer, it shows the main website page.

I have been trying for several days, searching tutorials on the internet about How To Host Multiple Websites Securely With Nginx And Php-fpm On Ubuntu 14.04. I tried many many many tutorials, but no one works. Even though I did the exactly the same as the tutorial shows.

It looks so easy to set the config, but why did I still fail even I have spent so much time.

Here are some basic informations:

  • My domain: kongming.io

  • My subdomain: song.kongming.io, which I want to create a link on my main website to link to.

  • My host: digitalocean

  • I am trying to use nginx to host multiple sites

  • My digitalocean droplet settings:

And my config settings are the same as the tutorial shows. FYI, it is showed below.

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

root /var/www/song.kongming.io;
index index.html index.htm;

server_name song.kongming.io www.song.kongming.io;

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

If you can point out any suggestions or any potential reasons that can cause my problem, I would be really appreciate. I don't know what is wrong with my settings, because I am new to the back end web services, and I really tried a lot. Thanks in advance!


回答1:


The problem is so tricky. One of my friend told me to clear the cookies and histories of my browser, and I did. And it works!

So this has nothing to do with the nginx config or domain settings. This is because of some bad things remaining in the history of browser.

I don't know why, it just happened.



来源:https://stackoverflow.com/questions/36990084/why-did-it-always-show-my-domains-webpage-when-i-enter-my-subdomains-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!