在8080端口上有一個nginx服務器偵聽,telnet與localhost和127.0.0.1。一個連接,一個連接失敗,否則。'localhost'和'127.0.0.1'有什麼區別?
[[email protected] sbin]$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
[[email protected] sbin]$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
'localhost'和'127.0.0.1'有什麼區別?爲什麼localhost連接失敗?謝謝!