title: How do I serve old xml sitemap after domain swap via nginx config
body: <p>I've recently swapped the domain extension of a site from .xyz to .com and I'm using a rule in my nginx config to 301 traffic from the old domain to the new one.</p>
  
  <pre><code>server {
      listen 8080;
      server_name example.xyz www.example.xyz;
      return 301 https://www.example.com$request_uri;
    }
  </code></pre>
  
  <p>However I want to continue serving a sitemap at example.xyz/sitemap.xml</p>
  
  <p>Is there a rule I can implement which will take preference over the 301 just for a single location? The sitemap can be a static file so I can use an alias but not sure how to stop the 301 taken effect for just that url?</p>