noFear
V2EX  ›  问与答

请教 docker 网络问题

  •  
  •   noFear · Feb 5, 2018 · 1901 views
    This topic created in 3020 days ago, the information mentioned may be changed or developed.
    刚开始学习 docker,用容器装了 nginx,启动后,此时访问 localhost 是没有问题的,但是如果宿主机上配置 host 如:
    127.0.0.1 a.com
    也加了 nginx 上对应 server 配置 但是此时是无法访问的,为什么?
    noFear
        1
    noFear  
    OP
       Feb 5, 2018
    nginx 配置:

    server {
    listen 80;
    server_name a.com;
    root /var/www/;
    index index.php index.html index.htm;
    }
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5540 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 08:00 · PVG 16:00 · LAX 01:00 · JFK 04:00
    ♥ Do have faith in what you're doing.