文章詳情頁
node - 阿里ubuntu服務(wù)器,外網(wǎng)通過ip訪問不了的問題?
瀏覽:161日期:2024-07-04 14:16:13
問題描述
寫了個demo(node官網(wǎng)那段hello world),在服務(wù)器上運(yùn)行無問題,curl localhost也可以返回,但外網(wǎng)訪問不了
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ǔ)充:防火墻沒開
問題解答
回答1:防火墻和安全組放行端口了嗎?
回答2:iptables要開對應(yīng)端口?我猜的
排行榜

熱門標(biāo)簽