title: Nginx Map Redirect Rule
body: <p>I want to redirect the following</p>
  
  <p>From Original URI:</p>
  
  <pre><code>ui/abc/def/vsphere.core.folder.manage?objectId=urn:vmomi:Folder:group-d1:5555-4444-3333-2222-111111111111
  </code></pre>
  
  <p>Into Redirect URI:</p>
  
  <pre><code>/ui
  </code></pre>
  
  <p>My desire is if the URI contain <code>5555-4444-3333-2222-111111111111</code> in the URL (don't care whatever before it), then it will be redirect to <code>/ui</code></p>
  
  <p>I tried this but it doesn't work. Please help me. Many thanks</p>
  
  <pre><code>map $request_uri $redirect {
      default 0;
  
  ~^5555-4444-3333-2222-111111111111(.*)?$ /ui;
  
  }
  </code></pre>