srobo / ansible

Ansible configuration for Student Robotics' pet machines
MIT License
0 stars 5 forks source link

Only permanently redirect known domains #2

Closed PeterJCLaw closed 2 years ago

PeterJCLaw commented 2 years ago

Currently any unrecognised domain gets a 301 to studentrobotics.org. This was an easy thing to get started with, but means that any DNS or nginx misconfiguration could easily have long lasting impacts.

Likely we should have a block for known domains that we do want a permanent redirect for and a separate block for the fallback which gets a temporary redirect. Having the exact list of these being configurable would be nice, even it only as a space separated string which is dropped in (like the secondary_hostnames key is).

PeterJCLaw commented 2 years ago

Having had another look at this it turns out that we're already emitting 302s by default. I think we probably do want to have the ability to permanently redirect to our canonical domains, but that's a different issue than I thought it was.