docs/_deploy/nginx
Sebastiaan van Stijn 628b77dc82
NGINX config: add redirect rules for obsolete archive pages
This adds redirect rules to redirect URLs for archives that are no longer hosted
to the current documentation.

Some test scenarios below to verify:

Current docs
--------------------------------------------------------------------------------

- http://localhost:4000/engine/reference/commandline/create
    - redirects to http://localhost:4000/engine/reference/commandline/create/ (with trailing slash)
- http://localhost:4000/engine/reference/commandline/create/
- http://localhost:4000/engine/reference/commandline/create/index.html

Archived docs for current archives (e.g. v18.09):
--------------------------------------------------------------------------------

- http://localhost:4000/v18.09/engine/reference/commandline/create
  - ideally this should redirect to http://localhost:4000/v18.09/engine/reference/commandline/create/ (with trailing slash)
- http://localhost:4000/v18.09/engine/reference/commandline/create/
- http://localhost:4000/v18.09/engine/reference/commandline/create/index.html

Non-existing pages
--------------------------------------------------------------------------------

These should produce a 404 (not found)

- http://localhost:4000/no/such/page/
- http://localhost:4000/v18.09/no/such/page/
    - redirects to http://localhost:4000/no/such/page/

URLs for archived versions that are not, or no longer, published
--------------------------------------------------------------------------------
These are not found, because we don't (or no longer) publish these archive versions.
Because they start with `/vXX.XX/`, we redirect them to the same location in the
current docs. Note that the location redirected to may not (or no longer) exist,
and as such could result in another 301 redirect, or a ultimately a 404 ("not found").

Given that these should not re-appear, these redirects use a 301 (permanent). There
is one corner case; URLs for _future_ releases (e.g. `/v20.03/`) will _also_ produce
a 301, which could be cached by browsers / proxies, and effectively "block" the
URL for future use. I don't think this is very problematic, or at least not
something we should care about.

- http://localhost:4000/v17.99/engine/reference/commandline/run
    - redirects to http://localhost:4000/engine/reference/commandline/run/ in the current docs
- http://localhost:4000/v17.99/engine/reference/commandline/run/
    - redirects to http://localhost:4000/engine/reference/commandline/run/ in the current docs
- http://localhost:4000/v17.99/engine/reference/commandline/run/index.html
    - redirects to http://localhost:4000/engine/reference/commandline/run/index.html  in the current docs

Non existing pages in archive paths
--------------------------------------------------------------------------------

- http://localhost:4000/v17.03/no/such/page/
    - redirects to http://localhost:4000/no/such/page/ in the current docs
    - which shows a 404 not found page

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-28 15:10:24 +01:00
..
default.conf NGINX config: add redirect rules for obsolete archive pages 2020-02-28 15:10:24 +01:00