1

I have a long-running request, which I want to handle in Play Framework which is behind an Nginx reverse proxy.

After about 3 minutes, I get a 502 Bad Gateway as a response. Play keeps working on the request, though.

I believe the Play Framework closes the socket. I tried to set the following configurations:

In Nginx

proxy_read_timeout 15m;
proxy_connect_timeout 15m;

In play framework's application conf:

play.server.http.idleTimeout = infinite
play.server.https.idleTimeout = infinite
play.server.akka.http.server.idle-timeout = infinite
play.server.akka.http.client.idle-timeout = infinite
play.server.akka.http.server.request-timeout = infinite
play.server.akka.http.client.connecting-timeout = infinite
play.server.akka.http.host-connection-pool.max-connection-lifetime = infinite
play.server.akka.http.host-connection-pool.idle-timeout = infinite
play.server.akka.http.host-connection-pool.client.idle-timeout = infinite

(I just added all settings that might be related and set them to infinite. Happy to throw all unrelated settings out.)

But that does not appear to change anything. After about 3 minutes I get a 502 BAd Gateway. Is there any way to keep the socket alive or is there another explanation for this behaviour?

Play Version: 2.7.2

Additional information:

I set all the values to extremely low values. All the play configuration doesn't seem to have any impact. The Nginx configurations works. So, I think it has nothing to do with those play settings.

I tried to confirm that it is actually happening in Play and not in Nginx. I took the time it takes to happen when the backend server could just start: 76 seconds. When it has to go through the get ready motions after being started (compiling, liquibase): 97 seconds. I believe that confirms that the issue is to be found in Play and not in Nginx or the frontend.

TheCommoner282
  • 205
  • 1
  • 7

0 Answers0