x-accel-redirect enables caching for POST requests

Руслан Закиров ruz at sports.ru
Wed Dec 23 12:54:31 UTC 2015


Hi,

If location /a/ redirects a POST request to location /b/ using
X-Accel-Redirect then result of the POST request is cached.

Tested this and reproduced with nginx 1.6.3 and 1.9.7.

Setup:
https://gist.github.com/ruz/4a66ee78fedf27181799

Logs from hitting /a/:
[1450873503.675] 200 HIT 127.0.0.1 "POST /a/ HTTP/1.1" [0.001, 0.001] {
127.0.0.1:5000}
[1450873504.113] 200 HIT 127.0.0.1 "POST /a/ HTTP/1.1" [0.001, 0.001] {
127.0.0.1:5000}
[1450873504.529] 200 HIT 127.0.0.1 "POST /a/ HTTP/1.1" [0.002, 0.002] {
127.0.0.1:5000}
[1450873567.648] 200 EXPIRED 127.0.0.1 "POST /a/ HTTP/1.1" [0.001 : 0.002,
0.003] {127.0.0.1:5000 : 127.0.0.1:5000}

Logs from hitting /b/ directly:
[1450875056.289] 200 - 127.0.0.1 "POST /b/ HTTP/1.1" [0.005, 0.005] {
127.0.0.1:5000}
[1450875058.073] 200 - 127.0.0.1 "POST /b/ HTTP/1.1" [0.001, 0.001] {
127.0.0.1:5000}

Looks like a bug to me. Do I miss something?


-- 
Руслан Закиров
Руководитель отдела разработки веб-сервисов
+7(916) 597-92-69, ruz @  <http://www.sports.ru/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20151223/793281ad/attachment.html>


More information about the nginx mailing list