Basically, you can configure any HTTP headers you want, either as a server or as a client.
If you specify a redirection, you must specify the Location header, as your example shows. You must also ensure that the response headers refer to this response and not to the resource to which the client is redirected. those. your headers may include Content-Length: 0, omit the Content-Type header, etc.
, , - .