Nginx config on reverse proxy for custom headers from backend to client

Solution 1:

proxy_set_header is meant to set additional headers when nginx proxies the client's request to backend server.

One use-case for this is to tell original client's IP address to backend server:

proxy_set_header X-Real-IP $remote_addr;

nginx forwards the responses from the server as-is, including all the headers. You don't need to configure anything for it.