Mass redirect using Nginx map file

After some migration between applications versions you need to keep backward compatibility. Here example of easy way how to redirect lot of links to new location for Nginx. (Example for Haproxy)

Virtual Host Configuration
map_hash_bucket_size 256;
map $request_uri $new_uri {
  include /etc/nginx/conf.d/;

server {
  listen 80;
  if ($new_uri) {
    return 302 $new_uri;
  location / {

Redirect MAP
#cat /etc/nginx/conf.d/


Popular posts from this blog

FreeRadius and Google Workspace LDAP