docs/legacy-redirects.map
: a file listing source and destination (separated by a space) ending each line with a ;
/source /destination;
/news/old-post-2005 /blog;
AFTER include
(L1) (NB: edit the domain)
map $uri$is_args$args $new_uri {
default 0;
include /home/forge/example.com/docs/legacy-redirects.map;
}
BEFORE location / {
if ($new_uri) {
return 301 $new_uri;
}
# Dynamically set the try_files locations.
# Statically cached files should only be loaded for GET requests.
set $try_files @default;
if ($request_method = GET) {
set $try_files @static;
}