嗨,剛剛發出的「你好世界」打印在http://192.168.99.100:8000/
而不是http://0.0.0.0:8000/
或local:8000
。Docker:輸出顯示在http://192.168.99.100:8000/而不是http://0.0.0.0:8000/
雖然它在聽:http://0.0.0.0:8000(1)。我想知道爲什麼會發生這種情況。有誰知道如何解決這一問題?謝謝!
端子輸出:
[2016-09-19 03:56:50 +0000] [1] [INFO] Starting gunicorn 19.4.5
[2016-09-19 03:56:50 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2016-09-19 03:56:50 +0000] [1] [INFO] Using worker: sync
[2016-09-19 03:56:50 +0000] [9] [INFO] Booting worker with pid: 9
192.168.99.1 - - [19/Sep/2016:04:08:25 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Kitematic/0.9.5 Chrome/45.0.2454.85 Electron/0.35.4 Safari/537.36"
192.168.99.1 - - [19/Sep/2016:04:08:30 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Kitematic/0.9.5 Chrome/45.0.2454.85 Electron/0.35.4 Safari/537.36"
192.168.99.1 - - [19/Sep/2016:04:08:39 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Kitematic/0.9.5 Chrome/45.0.2454.85 Electron/0.35.4 Safari/537.36"
192.168.99.1 - - [19/Sep/2016:04:08:43 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Kitematic/0.9.5 Chrome/45.0.2454.85 Electron/0.35.4 Safari/537.36"
[2016-09-19 04:09:14 +0000] [1] [INFO] Starting gunicorn 19.4.5
[2016-09-19 04:09:14 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2016-09-19 04:09:14 +0000] [1] [INFO] Using worker: sync
[2016-09-19 04:09:14 +0000] [9] [INFO] Booting worker with pid: 9
192.168.99.1 - - [19/Sep/2016:04:09:30 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.27 Safari/537.36"
192.168.99.1 - - [19/Sep/2016:04:09:31 +0000] "GET /favicon.ico HTTP/1.1" 404 233 "http://192.168.99.100:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.27 Safari/537.36"
[2016-09-19 04:10:27 +0000] [1] [INFO] Starting gunicorn 19.4.5
[2016-09-19 04:10:27 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2016-09-19 04:10:27 +0000] [1] [INFO] Using worker: sync
[2016-09-19 04:10:27 +0000] [9] [INFO] Booting worker with pid: 9
[2016-09-19 04:13:47 +0000] [1] [INFO] Starting gunicorn 19.4.5
[2016-09-19 04:13:47 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2016-09-19 04:13:47 +0000] [1] [INFO] Using worker: sync
[2016-09-19 04:13:47 +0000] [9] [INFO] Booting worker with pid: 9
192.168.99.1 - - [19/Sep/2016:04:13:52 +0000] "GET/HTTP/1.1" 200 12 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.27 Safari/537.36"
「Listening at:http://0.0.0.0」表示「正在監聽每個本地地址/主機名」,請參閱[This SO Question](http://serverfault.com/questions/78048/whats-the-difference- between-ip-address-0-0-0-0-and-127-0-0-1)以獲取詳細信息 – PeterT
感謝PeterT!我現在明白,但爲什麼然後本地:8000或0.0.0.0:8000不能顯示?我該如何解決這個問題? – user3368526