文章詳情頁(yè)
node - 阿里ubuntu服務(wù)器,外網(wǎng)通過(guò)ip訪問(wèn)不了的問(wèn)題?
瀏覽:191日期:2024-07-04 14:16:13
問(wèn)題描述
寫(xiě)了個(gè)demo(node官網(wǎng)那段hello world),在服務(wù)器上運(yùn)行無(wú)問(wèn)題,curl localhost也可以返回,但外網(wǎng)訪問(wèn)不了
const http = require(’http’)http.createServer(function(req,res){res.writeHead(200,{’Content-Type’:’text/plain’})res.end(’hello world’)}).listen(8082)console.log(’server running on http://localhost:8082’)
補(bǔ)充:防火墻沒(méi)開(kāi)
問(wèn)題解答
回答1:防火墻和安全組放行端口了嗎?
回答2:iptables要開(kāi)對(duì)應(yīng)端口?我猜的
排行榜

熱門(mén)標(biāo)簽