title: Drupal: Gateway Timeout The gateway did not receive a timely response from the upstream server or application
body: <p>A few days ago I am struggling with this error :
  "Gateway Timeout The gateway did not receive a timely response from the upstream server or application" (504 error) , this error only happens after the register form is submitted (by Drupal 7). </p>
  
  <p><strong>What I did/checked?</strong></p>
  
  <ol>
  <li><p>Checking the httpd log errors. 
  Here I only find this :
  <strong>[proxy_fcgi:error]</strong> [pid 2116] (70007)The timeout specified has expired: [client 10.17.12.27:62110] AH01075: Error dispatching request to : (polling), referer: <a href="https://r-sxxxxx-low-lq22-pry-837193.eu-west2.pry.amazonaws.com/user/register" rel="nofollow noreferrer">https://r-sxxxxx-low-lq22-pry-837193.eu-west2.pry.amazonaws.com/user/register</a> (this is not the real URL nor the IP, I've edited them).</p></li>
  <li><p>PHP logs errors (nothing there)</p></li>
  <li><p>Checking the timeOut and exec_limit const from php.ini and the
  apache server. I tried to increase these values, but the error still
  there.</p></li>
  <li><p>I discovered that the IP 10.17.12.27 it is a subnet from my AWS infrastructure (I am not an AWS expert at all, but I found it searching this IP in my AWS console).</p></li>
  </ol>
  
  <p><strong>I have 3 environments with the same code and the same database running (same modules enable):</strong></p>
  
  <ol>
  <li><p>Test env, has this error message (AWS linux server).</p></li>
  <li><p>Prod env, has this error message as well (AWS linux server).</p></li>
  <li><p>and the third one is my local machine (docker), and here it is
      working fine, not any Gateway error.</p></li>
  </ol>
  
  <p>note: Apache conf has not any reverse proxy for this thing, I only have one, but it is only triggered when the url has the param /blog no /user or /user/register.</p>
  
  <p><strong>This error only happens when the register form is submitted</strong>, but the weird thing it is that the user is successfully register on the db, an email is sent to the user etc... but instead of redirect to home (or another page), the 504 error is raised (not in local).</p>
  
  <p>I really would like to understand this, because at the moment I spent many hours trying to find a solution googling around, debugging, etc... but I did not find anything yet. </p>
  
  <p>Any idea?</p>