Java AWS Server:502 Bad Gateway nginx / 1.8.1 [英] Java AWS Server: 502 Bad Gateway nginx/1.8.1

查看:1466
本文介绍了Java AWS Server:502 Bad Gateway nginx / 1.8.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过eclipse上传我的应用程序后,我收到502错误的网关错误,我不明白为什么会发生这种情况?



我通过AWS创建了一个示例应用程序Elastic Beanstalk控制台。然后我在eclipse中加载了服务器。之后我发布了它并获得了环境更新成功完成。 EB控制台中的消息。但是,当我转到网址时,我收到502 Bad Gateway错误。我查看了日志,看看出了什么问题但是我发现只有

失败(111:连接被拒绝)连接到上游,客户端:172.31 .11.136,server :, request:GET /favicon.ico HTTP / 1.1,上游: http:/ /127.0.0.1:5000/favicon.ico ,主持人:k ***** t.3attvpxcin.us-east-1.elasticbeanstalk.com,推荐人: http:// k ***** t.3attvpxcin.us-east-1.elasticbeanstalk.com /





在application.jar中没有主要的清单属性



我不知道错误是什么。非常感谢任何帮助



这是我从EB控制台获取的日志的链接。
https://drive.google.com/file/d / 0B_Z-8IMBX2LcMW9yd2xsUTVzNVk / view?usp = sharing

解决方案

当你选择Java作为容器时,你的jar应该是一个可执行的jar。
即如果你从你的控制台使用jar命令运行它也应该在那里失败。



你应该做些什么来解决它使用插件构建它

例如

 < build> 
< plugins>
< plugin>
< groupId> org.springframework.boot< / groupId>
< artifactId> spring-boot-maven-plugin< / artifactId>

< / plugin>
< / plugins>

< / build>

这将解决jar问题中的无清单,你可以通过
来验证1.运行来自命令提示的jar或
2.在winrar中打开jar或看看maifest.mf文件的内容



ngix问题不同


I am getting the 502 bad gateway error after uploading my application via eclipse and I don't understand why its happening?

I created a Sample Application through the AWS Elastic Beanstalk Console. Then I loaded the server in eclipse. Afterwards I published it and got the "Environment update completed successfully." message in the EB Console. However when I go to the url, I get a 502 Bad Gateway error. I looked at the logs to see what went wrong however only thing I found is

"failed (111: Connection refused) while connecting to upstream, client: 172.31.11.136, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:5000/favicon.ico", host: "k*****t.3attvpxcin.us-east-1.elasticbeanstalk.com", referrer: "http://k*****t.3attvpxcin.us-east-1.elasticbeanstalk.com/"

and

"no main manifest attribute, in application.jar"

I don't know what else the error is. Any help will be greatly appreciated

Here is a link to the logs that I fetched from EB Console. https://drive.google.com/file/d/0B_Z-8IMBX2LcMW9yd2xsUTVzNVk/view?usp=sharing

解决方案

When you select Java , as a container then your jar should be an executable jar. i.e if you run using jar command from your console it should fail there as well.

what you should do to resolve it build it using plugin
e.g

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>

        </plugin>
    </plugins>

</build>

this will solve the no manifest in jar issue , you can verify by 1. running jar from command propmpt or 2. open jar in winrar or something and see the content of maifest.mf file

the ngix issue is different

这篇关于Java AWS Server:502 Bad Gateway nginx / 1.8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆