title: 502 Proxy | Who is culprit Wildfly or Spring Boot or Httpd? | Invalid response from an upstream server
body: <p>We are not sure whether it is Wildfly Server, Spring Boot app, HTTPD or anything else?</p>
  <pre><code>&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;502 Proxy Error&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;Proxy Error&lt;/h1&gt;
      &lt;p&gt;The proxy server received an invalid
          response from an upstream server.&lt;br /&gt;
  The proxy server could not handle the request
          &lt;em&gt;&lt;a href=&quot;/terp-offerings-rest-0.0.1-SNAPSHOT-wildfly10/offerings/all&quot;&gt;GET&amp;nbsp;/terp-offerings-rest-0.0.1-SNAPSHOT-wildfly10/offerings/all&lt;/a&gt;&lt;/em&gt;.
          &lt;p&gt;
              Reason: &lt;strong&gt;Error reading from remote server&lt;/strong&gt;&lt;/p&gt;
      &lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>Request goes and in 2 minutes it tries to fetch response from db but in 1 minute client end gets proxy error.</p>
  <p>In Spring Boot I did following:</p>
  <pre><code>@GetMapping(&quot;/offerings/all&quot;)
  @Transactional(timeout = 600000)
  public List&lt;XxtoneOfferingsV&gt; getAllOfferings(){
  </code></pre>
  <p>and</p>
  <pre><code>spring.mvc.async.request-timeout=600000
  </code></pre>
  <p>But in vain same error.</p>
  <p>Following i tried in wildfly:</p>
  <pre><code>Profile -&gt; servergroup -&gt; Undertow -&gt; Server -&gt; AJP/HTTP/HTTPS (Changed norequesttimeout to 600000 and readtimeout to 600000
  </code></pre>
  <p>Got nothing....</p>