<p>How can we conditionally append "index.html" to a request for a url that ends in a slash?</p>

<p>As background:
We deploy multiple static, single page apps for multiple domain names to a single S3 bucket with web hosting enabled. This bucket is available as: 
    <a href="https://our-bucket-name.s3.amazonaws.com" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com</a></p>

<p>The bucket is organized with object key prefix so that:
    <a href="https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/index.html" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/index.html</a>
    <a href="https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.css" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.css</a>
    <a href="https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.js" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com/environment/app_name/build_id/app.js</a></p>

<p>If there is a request for: 
    <a href="https://www.example.com/" rel="nofollow noreferrer">https://www.example.com/</a>
This should be routed to:
   <a href="https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/index.html" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/index.html</a></p>

<p>If there is a request for: 
    <a href="https://www.example.com/app.css" rel="nofollow noreferrer">https://www.example.com/app.css</a>
This should be routed to:
    <a href="https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/app.css" rel="nofollow noreferrer">https://our-bucket-name.s3.amazonaws.com/environment/app-name/build_id/app.css</a></p>

<p>Not sure if it is relevant, but traefik here is for a kubernetes ingress that we want backed by AWS S3.</p>

<p>You could use AddPrefix or ReplacePath modifier, though you would also need to create a matcher on your fontend as well.</p>

<p>STEPS</p>

<ol>
<li>create front end to match blank path rule</li>
<li>add modifier to that front end.  ReplacePath should do the trick</li>
<li>route to backend</li>
</ol>
