![](/img/trans.png)
[英]Proxy Error 502 : The proxy server received an invalid response from an upstream server
[英]502 Proxy | Who is culprit Wildfly or Spring Boot or Httpd? | Invalid response from an upstream server
我們不確定它是 Wildfly Server、Spring Boot app、HTTPD 還是其他?
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>502 Proxy Error</title>
</head>
<body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request
<em><a href="/terp-offerings-rest-0.0.1-SNAPSHOT-wildfly10/offerings/all">GET /terp-offerings-rest-0.0.1-SNAPSHOT-wildfly10/offerings/all</a></em>.
<p>
Reason: <strong>Error reading from remote server</strong></p>
</p>
</body>
</html>
請求在 2 分鍾內嘗試從數據庫獲取響應,但在 1 分鍾內客戶端收到代理錯誤。
在 Spring Boot 中,我做了以下操作:
@GetMapping("/offerings/all")
@Transactional(timeout = 600000)
public List<XxtoneOfferingsV> getAllOfferings(){
和
spring.mvc.async.request-timeout=600000
但同樣的錯誤是徒勞的。
以下我在 wildfly 中嘗試過:
Profile -> servergroup -> Undertow -> Server -> AJP/HTTP/HTTPS (Changed norequesttimeout to 600000 and readtimeout to 600000
什么都沒有....
除了上述設置
在 HTTPD.CONF 中添加了以下內容
Timeout 300
ProxyTimeout 300
ProxyBadHeader Ignore
它成功地工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.