2232588429
V2EX  ›  问与答

请教一个问题,一个主机 www 目录里有两个域名,如果在浏览器直接打开主机 IP,默认是打开哪个域名?这个是随机还是固定的?

  •  
  •   2232588429 · Dec 22, 2014 · 2339 views
    This topic created in 4243 days ago, the information mentioned may be changed or developed.
    如题,如果有规则是在哪里指定的?
    2 replies    2014-12-22 11:29:28 +08:00
    logfile
        1
    logfile  
       Dec 22, 2014   ❤️ 1
    浏览器直接打开主机 IP,是根据你的配置来打开网页

    apache的话,检查一下/etc/apache2/http.conf(/etc/httpd/http.conf)配置,看看有没有root指向目录,或者虚拟主机配置目录。
    nginx 的话,检查/etc/nginx/nginx.conf配置,vhost有没有配置
    Starduster
        2
    Starduster  
       Dec 22, 2014   ❤️ 1
    取决于服务端的配置
    我只知道 nginx,如果设置了 default_server 就是打开这个页面,如果配置里监听了 IP + 端口 那也会根据设置打开。如果什么都没设置,那就是按字母顺序打开配置文件第一个或者 nginx.conf 里排最前面的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5711 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.