繁体   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