nginx – Ensuring Redirects on a Proxied Server work correctly

So I am currently trying to understand what configuration is a good idea for an nginx proxy. I am a bit stuck on the following two options:

  • proxy_set_header Host $host;
  • proxy_redirect default; (which is the default anyway and thus superflous)

If I understand it correctly then they both seem to target the same goal: ensuring that redirect work correctly. Setting the header variable Host to $host (which is the name of the nginx server, while the default ($proxy_host) is the name of the proxy server), ensures that the proxy server “views itself as $host” and thus links paths of type /some/sub/path to resources at $host/some/sub/path instead of $proxy_host/some/sub/path.

But this seems to be the purpose proxy_redirect is for as well. So I am not sure what to make of this. Maybe I am not really understanding those parameters quite right.