Redirects and


So repo has a ton of redirects from old systems (I see for sure drupal at one point). The current solution isn’t too bad. Essentially for each redirect, create a page that does a meta HTML redirect, and move the user to the new location.

This has a couple of issues though.

  1. Pages are still HTML files, so status code 200, so google will index both of them. Meaning lots of traffic to old URLs, and hard to get rid of them
  2. Sitemap.xml has all of those redirects, so see #1
  3. Waste of bandwidth to just do a redirect
    ?) Wonder how Algolia handles the redirect pages? hopefully properly

Long term, I know that @dduportal has plans on hooking up individual docker images for both and so we can have all the redirects and other Nginx configs baked right into the image. I know there are some blockers for that, and it’s not a priority.

So I’m wondering if there are other ways this could be handled. The only way I could think of is creating a C or LUA module that reads a redirects.json or something from the disk, and feeds it into Nginx at runtime (with a caching period).

It might be fun to write, but I’m not sure it is worth the effort. I want to have the discussion though.

Original thread from IRC

Good point! It seems that @hlemeur used a generator for the work he did on th wiki.
There was a lot of Apache redirects that had to be converted to nginx: it seems there are converters.

The LUA module (please, avoid a C module that would require us to recompile Nginx :scream: ) could be a fun project: it seems a good idea.

Ideally, do you think it could be possible to have a generator (shell, Lua, C, Golang, whatever) that would generate a static list of these redirects into nginx configuration format (docker-confluence-data/nginx.conf at 8cf88c1c8eef1b7f2adc8ec0ca56a589bd4bccd8 · jenkins-infra/docker-confluence-data · GitHub)?

Can I generate all the redirects in the codebase? yep absolutely