It's best-practice to not define these inside a "location" block
to prevent having to re-define them for each location.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use relative redirects to account for situations where a front-end
proxy is used and the container does not know the public domain and
port.
Before this change, when running locally (on localhost:4000), redirects would omit
the port number, and redirect to localhost _without_ port number:
curl -v "http://localhost:4000/engine/reference/commandline/run"
* TCP_NODELAY set
* Connected to localhost (::1) port 4000 (#0)
> GET /engine/reference/commandline/run HTTP/1.1
> Host: localhost:4000
> User-Agent: curl/7.65.3
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.17.8
< Date: Fri, 28 Feb 2020 13:46:10 GMT
< Content-Type: text/html
< Content-Length: 169
< Location: http://localhost/engine/reference/commandline/run/
< Connection: keep-alive
After this change, redirect will be "relative", so redirecting to the correct location:
curl -v "http://localhost:4000/engine/reference/commandline/run"
* TCP_NODELAY set
* Connected to localhost (::1) port 4000 (#0)
> GET /engine/reference/commandline/run HTTP/1.1
> Host: localhost:4000
> User-Agent: curl/7.65.3
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.17.8
< Date: Fri, 28 Feb 2020 13:39:02 GMT
< Content-Type: text/html
< Content-Length: 169
< Connection: keep-alive
< Location: /engine/reference/commandline/run/
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The docs/docker.github.io:nginx-onbuild has not been
updated for a while, and having a local file present
allows for easier updating it (for example, to add
wildcard redirects).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>