Regression in 1.14 when following upstream redirects

vedranf nginx-forum at forum.nginx.org
Wed May 16 14:08:23 UTC 2018


Hey,


Maxim Dounin Wrote:
-------------------------------------------------------
> Hello!
> 
> On Mon, May 14, 2018 at 01:22:46PM -0400, vedranf wrote:
> 
> > There is a problem when nginx is configured to try to follow
> redirects (301)
> > from upstream server in order to cache responses being directed to,
> rather
> > than the short redirect itself. This worked in 1.12 and earlier
> releases.
> > Here is the simplified configuration I use and which used to work:
> > 
> 
> From the incomplete configuration and debug log snippets you've 
> provided it looks like your problem if that requests previously 
> not cached now successfully extracted from cache.
> 
> From the snippets you've provided it is not possible to conclude 
> if the previous behaviour was buggy and now fixed (and your 
> previous configuration worked due to a bug), or the new behaviour 
> is incorrect.
> 
> There are at least some fixes in 1.13.x which might affect your 
> configuration.  In particular, this fix in 1.13.6 might be 
> related:
> 
>     *) Bugfix: cache control headers were ignored when caching errors
>        intercepted by error_page.

Right, this seems to be causing it. I was able to replicate it only when 3XX
redirect had Cache-Control set. Please look at the minimal configuration at:
https://pastebin.com/tSqH4YJt
with 1.12 you always get 204 response from 127.0.0.1:8181, with 1.14 first
response is 204, but the subsequent responses are 500 with invalid URL
prefix in "" error because in the second attempt request never goes to
upstream (perhaps it assumes file is supposed to be in cache) and the
variable is empty.

Regards,
Vedran

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279787,279819#msg-279819



More information about the nginx mailing list