Hello,
I am running a site that uses Django 1.8 and Django CMS 3.2. The site is deployed using gunicorn and nginx. Now I noticed a strange, hard to debug issue: When accessing a URL without trailing slash, I expect a redirect to the correct URL with the trailing slash appended, as per the APPEND_SLASH setting. This usually works, but sometimes I get a 404 instead of the correct 301. I can reproduce this using curl:
$ curl -I
http://khk.ceres.rub.de/en/research/focus-groups/notionsHTTP/1.1 404 NOT FOUND
Server: nginx/1.6.2
Date: Fri, 16 Sep 2016 15:54:40 GMT
Content-Type: text/html
Connection: keep-alive
x-xss-protection: 1; mode=block
Content-Language: en
x-content-type-options: nosniff
Vary: Cookie
X-Frame-Options: SAMEORIGIN
Set-Cookie: django_language=en; expires=Sat, 16-Sep-2017 15:54:40 GMT; Max-Age=31536000; Path=/
$ curl -I
http://khk.ceres.rub.de/en/research/focus-groups/notionsHTTP/1.1 301 MOVED PERMANENTLY
Server: nginx/1.6.2
Date: Fri, 16 Sep 2016 15:54:42 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
x-xss-protection: 1; mode=block
Content-Language: en
x-content-type-options: nosniff
Vary: Cookie
Location:
http://khk.ceres.rub.de/en/research/focus-groups/notions/X-Frame-Options: SAMEORIGIN
Set-Cookie: django_language=en; expires=Sat, 16-Sep-2017 15:54:42 GMT; Max-Age=31536000; Path=/
I am a bit clueless why this behaviour is so unpredictable. Any ideas what might be going on here, or how to trace this?
Thanks,
Frederik