I am using content_by_lua_block to retrieve some values from memcached and then pass these to another location directive to use as a cache key.
I'm running into an issue where uwsgi is returning "invalid uwsgi request (current strsize: 28532). skip" when setting custom headers.
This is the error from nginx:
2017/11/05 05:20:35 [error] 1339#1339: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.18.0.12, server: , request: "GET /test HTTP/1.1", upstream: "uwsgi://unix:///var/run/nginx/app.sock:", host: "local.develop.com"
uwsgi error:
invalid uwsgi request (current strsize: 28532). skip
The location directives
local utils = require "utils"
local session_info = utils.get_session_user_and_team_id()
ngx.req.set_header('proxy-team-id', session_info.team_id)
ngx.req.set_header('proxy-user-id', session_info.user_id)
location @myapp {
set $cache_key "nginx_${http_proxy_user_id}_${http_proxy_team_id}";
srcache_fetch GET /memc $cache_key;
srcache_store PUT /memc $cache_key;
srcache_store_statuses 200 301 302;
include uwsgi_params;
uwsgi_pass appupstream;
}
The request works when I comment out the set_header fields, this leads me to think maybe lua / ngx.exec is not properly doing the uwsgi_pass or something ?
Maybe there is a better way to do this kind of forwarding, I used ngx.exec since set_by_lua_block does not support making calls to memcaced.
openresty/1.11.2.5
uwsgi 2.0.15
Using this from inside docker container python:2.7.14-slim.