fix: Use relative redirects to prevent dropping the port (#43)
fix: Use relative redirects to prevent dropping the port (#43)

`curl --head http://localhost:8001/some-url` with no trailing slash results in a redirect issued by nginx unless a valid file match. The 301 redirect response header `Location` field provides an absolute value of `http://localhost/some-url/`, the port has been dropped.

`port_in_redirect on;` in the nginx config will append the port that nginx has been configured to listen on(default `80`). If you toggle this config option, and had changed `$HTTP_PORT` to `8002`, you would get a `Location` response of `http://localhost:8002/some-url/`, matching the port instead to the one the running container has mapped `8002:8002` instead of `8001:8002` should work.

`absolute_redirect off;` switches from absolute, to relative redirects. This has nginx return a `Location` response header field value of `/some-url/` instead, discarding the URI sheme(`http://`) and `hostname:port` which define the "absolute" part of a the `Location` value. It is still treated as a 301 redirect, but requires no need to adjust the `$HTTP_PORT` env var. Should not cause any issues.
gatsbyjs/gatsby-docker