我在elastic-beanstalk上部署了我的产品。
访问api服务器时,将返回502 Bad Gateway。
这是堆栈。
・client: react/axios
・api: golang/gin
・web server: nginx
・db: mysql
・container: docker
・ci-tool: travis
・deploy: aws elastic beanstalk完整的源代码如下:
https://github.com/jpskgc/article
在我的本地docker环境中,向api服务器请求没有问题。
但是在弹性豆杆环境中,它返回502 Bad Gateway。
这是实际的网址。
http://multidocker-env.vwnrixavuv.ap-northeast-1.elasticbeanstalk.com/api/articles
发布于 2019-08-12 04:11:15
我在服务器日志中发现了这个错误。
-------------------------------------
/var/log/containers/server-e34065c90525-stdouterr.log
-------------------------------------
/usr/local/go/pkg/tool/linux_amd64/link: signal: killed这是由于内存不足造成的。
因此,我修正了将api的内存从128增加到Dockerrun.aws.json中的512。
{
"name": "server",
"image": "jpskgc/multi-api",
"hostname": "api",
"essential": false,
"memory": 512
},https://stackoverflow.com/questions/57439827
复制相似问题