簡體   English   中英

Adonis - Elastic BeanStalk 上的 502 錯誤網關

[英]Adonis - 502 Bad Gateway on Elastic BeanStalk

我正在嘗試在 Elastic Beanstalk 上部署 AdonisJS 應用程序。 我已經按照幾個教程這樣做,但我得到 502 Bad Gateway:(

按照所有教程中的建議,我已從配置門戶將PORT env 變量設置為 8081。

----------------------------------------
/var/log/nginx/error.log
----------------------------------------
2020/12/28 19:54:52 [error] 5218#0: *266 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.xxx.xx, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "172.xx.xx.x"
----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Dec 28 20:06:36 ip-xxx-31-30-5 web: > adonis-api-app@4.1.0 start /var/app/current
Dec 28 20:06:36 ip-xxx-31-30-5 web: > node server.js
Dec 28 20:06:37 ip-xxx-31-30-5 web: #033[32minfo#033[39m: serving app on http://xxxxx-api-staging.us-west-2.elasticbeanstalk.com:8081
Dec 28 20:06:37 ip-xxx-31-30-5 web: events.js:291
Dec 28 20:06:37 ip-xxx-31-30-5 web: throw er; // Unhandled 'error' event
Dec 28 20:06:37 ip-xxx-31-30-5 web: ^
Dec 28 20:06:37 ip-xxx-31-30-5 web: Error: listen EADDRNOTAVAIL: address not available 44.242.xx.xx:8081
Dec 28 20:06:37 ip-xxx-31-30-5 web: at Server.setupListenHandle [as _listen2] (net.js:1300:21)
Dec 28 20:06:37 ip-xxx-31-30-5 web: at listenInCluster (net.js:1365:12)
Dec 28 20:06:37 ip-xxx-31-30-5 web: at GetAddrInfoReqWrap.doListen [as callback] (net.js:1502:7)
Dec 28 20:06:37 ip-xxx-31-30-5 web: at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:68:8)
Dec 28 20:06:37 ip-xxx-31-30-5 web: Emitted 'error' event on Server instance at:
Dec 28 20:06:37 ip-xxx-31-30-5 web: at emitErrorNT (net.js:1344:8)
Dec 28 20:06:37 ip-xxx-31-30-5 web: at processTicksAndRejections (internal/process/task_queues.js:84:21) {
Dec 28 20:06:37 ip-xxx-31-30-5 web: code: 'EADDRNOTAVAIL',
Dec 28 20:06:37 ip-xxx-31-30-5 web: errno: 'EADDRNOTAVAIL',
Dec 28 20:06:37 ip-xxx-31-30-5 web: syscall: 'listen',
Dec 28 20:06:37 ip-xxx-31-30-5 web: address: '44.242.xx.xx',
Dec 28 20:06:37 ip-xxx-31-30-5 web: port: 8081
Dec 28 20:06:37 ip-xxx-31-30-5 web: }
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! code ELIFECYCLE
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! errno 1
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! adonis-api-app@4.1.0 start: `node server.js`
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! Exit status 1
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR!
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! Failed at the adonis-api-app@4.1.0 start script.
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR! A complete log of this run can be found in:
Dec 28 20:06:37 ip-xxx-31-30-5 web: npm ERR!     /home/webapp/.npm/_logs/2020-12-28T20_06_37_082Z-debug.log

請幫忙,因為它現在變得非常令人沮喪:(

謝謝

使用0.0.0.0作為HOST變量。

發生錯誤是因為無法訪問應用程序。 設置HOST=0.0.0.0使服務器監聽所有接口。

您可以在此處查看有關0.0.0.0的更多詳細信息: 0.0.0.0、127.0.0.1 和 localhost 有什么區別?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM