title: AWS CloudFront - Use path path based routing to pull in content from external server
body: <p>I'm having difficulty mapping a path-based route defined in CloudFront to custom domain. Any ideas what I need to change?</p>
  
  <p><strong>Background</strong>:
  I've got a Vue app that I host on AWS in this way. This all works fine.</p>
  
  <ul>
  <li>I build and push files to an s3 bucket (www.example.com). </li>
  <li>CloudFront distribution that has an origin set up with that bucket (www.example.com.s3-website-us-west-1.amazonaws.com). </li>
  <li>A CNAME record from www to the Cloudfront domain name (d111111abcdef8.cloudfront.net)  </li>
  </ul>
  
  <p>Now I want content from a separate domain on a separate server to show up as a path on the domain rather than a subdomain like it is now. I have a blog at blog.example.com that I would like to see as www.example.com/blog.</p>
  
  <p>I went through these steps:</p>
  
  <ol>
  <li>Add new custom origin to the Cloudfront distribution (blog.example.com)</li>
  <li>Add a new behavior to Cloudfront distribution with path pattern="blog" and Origin set to the one above ("Custom-blog.example.com")</li>
  <li>Set the new behavior as priority 0 and the default (*) to priority 1</li>
  </ol>
  
  <p><a href="https://d111111abcdef8.cloudfront.net/blog" rel="nofollow noreferrer">https://d111111abcdef8.cloudfront.net/blog</a> does a redirect to <a href="https://blog.example.com" rel="nofollow noreferrer">https://blog.example.com</a> </p>
  
  <p>but <a href="https://www.example.com/blog" rel="nofollow noreferrer">https://www.example.com/blog</a> does not </p>
  
  <p>Any ideas?</p>
  
  <p>Here the config images:</p>
  
  <p>Origin:</p>
  
  <p><a href="https://i.stack.imgur.com/Jnoh5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Jnoh5.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>Behavior:</p>
  
  <p><a href="https://i.stack.imgur.com/MeQhg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MeQhg.png" alt="enter image description here"></a></p>