<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi guys,</div>
<div><br>
</div>
<div>I have a small scenario where I have a backend (s3 compatible storage), which by default generates a directory listing overview of the files stored.</div>
<div>I want to be able to serve an "index.html" file if the file exists, else just proxy_pass as normally.</div>
<div><br>
</div>
<div><a href="https://gist.github.com/lucasRolff/c7ea13305e9bff40eb6729246cd7eb39">https://gist.github.com/lucasRolff/c7ea13305e9bff40eb6729246cd7eb39</a></div>
<div><br>
</div>
<div>My nginx config for somewhat reason doesn't work – or maybe it's because I misunderstand how try_files actually work.</div>
<div><br>
</div>
<div>So I have URLs such as:</div>
<div><br>
</div>
<div>minio.box.com/bucket1/</div>
<div>minio.box.com/bucket43253/</div>
<div><br>
</div>
<div><br>
</div>
<div>When I request these URL's I want nginx to check if index.html exists in the directory (it's an actual file on the filesystem) - if it does, serve this one, else go to @minio location.</div>
<div><br>
</div>
<div>For any other file within the directory, I will just go to @minio location so if I request unicorn.png it should go in @minio location as well.</div>
<div><br>
</div>
<div>Is there any decent (non-evil) way of doing this?</div>
<div><br>
</div>
<div>I assume I have to define the root directive to make try_files work, but what would I actually have to define, to make nginx use try_files for index.html *within* the specific bucket?</div>
<div><br>
</div>
<div>Thanks in advance</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</body>
</html>