Is there a way to return the request's protocol in a header?

I forward from nginx to a worker and I’m experimenting with setting up HTTP/2 on the upstream side using grpc_pass (experimental and not recommended, I know).

At first glance it seems to be working but I have no way of actually validating that so I thought about returning the protocol in a response header and then logging that in nginx using the generic $upstream_http_x variable.

I tried accessing the protocol via event.request.protocol but I always get undefined. Is this possible?