首页  >  问答  >  正文

nginx server_name配置问题

配置文件

server {
        listen       8899;
        server_name  tc.com;

        location / {
            root   html;
            index  index.html index.htm;
       }
    }

浏览器访问tc.com:8899没用,但是使用localhost:8899有用,这是为什么?

为情所困为情所困2714 天前485

全部回复(2)我来回复

  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:11:05

    我怀疑你不知道 DNS 和 域名 还有 server_name 是什么区别

    回复
    0
  • 迷茫

    迷茫2017-05-16 17:11:05

    忘改hosts了

    回复
    0
  • 取消回复