We are working with a piece of hardware(chromecast) that seems to be stripping out cookies, but will happily pass along a custom header (which we signal is acceptable from the back end) one workaround we came up to stuff the cookie data into said custom header and put it back into the cookie header on the proxy. This allows most clients (which respect normal CORS signaling) and the backend to remain unchanged. In my Nginx config I currently have a map defined like:
map cookie $cookie {
default $http_cookie;
"" $http_my_token;
}
which I'm later using as follows:
server {
listen 443 ssl;
#...
location /myurl {
proxy_pass http://nodeserver;
proxy_set_header X-Forwarded-For $remote_addr;
#...
proxy_set_header Cookie $cookie;
}
}
I expect this code to replace the Cookie header with the value supplied in the "My-Token" header, but what I see instead is that the value of both headers is passed through unchanged.