Pcre
NGinx rewrite rules
I use
nginx
as a reverse-proxy for a side-project. It’s job is to sit between the user and the various back-end services. It’ll then serve the correct otherwise-inaccessible service depending on the URI or the port.One of the hidden services is a
minio
storage. I use it to host multiple static websites with dynamic names. So I need to craft the correctnginx
configuration to serve the right files depending on the requested URL.There is a great deal of
nginx
documentation and many stack overflow pages regarding its configuration. But they all consider the domain-name to be some sort or logical root. This is not the case in this article and a simple trick allowed me to keep the configuration generic in term of bucket’s name and navigation’s depth.