Filippo Giunchedi has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/345315 )

Change subject: Use proper proxy_next_upstream configuration for Thumbor's nginx
......................................................................


Use proper proxy_next_upstream configuration for Thumbor's nginx

Bug: T161613

It turns out that proxy_next_upstream_tries counts the initial attempt.
Which means we were never retrying with the next upstream on error/timeout.
Timeout removed because proxy_read_timeout should apply to the retry.

Change-Id: Ic0b3624995b81a6c6a046bd9589495125547120e
---
M modules/thumbor/templates/nginx.conf.erb
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Filippo Giunchedi: Looks good to me, approved



diff --git a/modules/thumbor/templates/nginx.conf.erb 
b/modules/thumbor/templates/nginx.conf.erb
index 1bfae10..9ae34f5 100644
--- a/modules/thumbor/templates/nginx.conf.erb
+++ b/modules/thumbor/templates/nginx.conf.erb
@@ -16,9 +16,10 @@
         keepalive_timeout 0;
         proxy_redirect off;
         proxy_buffering off;
-        # fallback to the next upstream at most once, and no longer than the 
same as proxy_read_timeout
-        proxy_next_upstream_timeout 180;
-        proxy_next_upstream_tries 1;
+        proxy_pass http://thumbor;
+        # fallback to the next upstream at most once
+        proxy_next_upstream error timeout invalid_header http_502 http_504;
+        proxy_next_upstream_tries 2;
         # Maximum pause between read operations. Thumbor stays silent while it 
processes
         # images, which means that this should be higher than the Thumbor 
processing total time limit
         proxy_read_timeout 180;
@@ -26,7 +27,6 @@
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header Request-Date $date_gmt;
-        proxy_pass http://thumbor;
         add_header X-Upstream $upstream_addr;
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/345315
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0b3624995b81a6c6a046bd9589495125547120e
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gilles <gdu...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to