From 674cb4784cae7af4010a9b537ed66ff0c9694759 Mon Sep 17 00:00:00 2001 From: Brendan Early Date: Oct 03 2021 00:07:23 +0000 Subject: Redirect any removed version pages to the package page. E.g. .../systemd/fedora-no-exist.html -> .../systemd --- diff --git a/container/nginx.conf b/container/nginx.conf index 5f10ab0..4df9f78 100644 --- a/container/nginx.conf +++ b/container/nginx.conf @@ -54,6 +54,15 @@ http { uwsgi_pass 127.0.0.1:3031; } + # Redirect any specific version pages that have been removed to the package page. + location ~ ^/pkgs/.+/.+/.+\.html$ { + try_files $uri @missing; + } + + location @missing { + rewrite ^(/pkgs/.+/.+/).+\.html$ $1 redirect; + } + error_page 404 /404.html; location = /40x.html { }