title: nginx conf file: Detect if browser language is "de", then redirect to page .... else redirect to other page
body: <p>I want to create a link in a banner to redirect to one of two pages. The link points to <code>subdomain.example.com/email</code>. If the browser language is "de" then go to <code>www.example.de/banner</code> else go to <code>www.example.com/banner</code>. My nginx conf language skills are not good, but I know that any browser language of German has the first two characters are "de" (see <a href="https://www.metamodpro.com/browser-language-codes" rel="nofollow noreferrer">https://www.metamodpro.com/browser-language-codes</a>). No other language has this.</p>
  
  <pre><code>location /email {
      if $http_accept_language === "de" { return 301 https://www.example.de/banner }
      else { return 301 https://www.example.com/banner}
  }
  </code></pre>