V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
noFear
V2EX  ›  问与答

请教 docker 网络问题

  •  
  •   noFear · 2018-02-05 13:19:50 +08:00 · 1211 次点击
    这是一个创建于 2278 天前的主题,其中的信息可能已经有所发展或是发生改变。
    刚开始学习 docker,用容器装了 nginx,启动后,此时访问 localhost 是没有问题的,但是如果宿主机上配置 host 如:
    127.0.0.1 a.com
    也加了 nginx 上对应 server 配置 但是此时是无法访问的,为什么?
    noFear
        1
    noFear  
    OP
       2018-02-05 13:24:03 +08:00
    nginx 配置:

    server {
    listen 80;
    server_name a.com;
    root /var/www/;
    index index.php index.html index.htm;
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   744 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:53 · PVG 04:53 · LAX 13:53 · JFK 16:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.