Gateway timeout with nginx/passenger standalone

I needed to run Rails apps with both ruby 1.8.7 and 1.9.2 on the same server. Passenger Standalone to the rescue! Setting up my 1.9.2 app as a standalone server and setting it up as proxy to it worked great. Until we had to upload and process some files. Turns out, the gateway server would timeout, even though the process was still processing on the app server. The proxing nginx server would reply with "Gateway Timeout 504". The fix from the nginx documentation: proxy_read_timeout My proxy config after this:
          location / {
            proxy_read_timeout 240s;

Established 2005 · Databasically © 2016