Hosting and serving terrain using nginx

Hello cesium community,

I have a .terraindb file that I would like to host using nginx and use it with the Cesium terrainProvider in my Cesiumjs application. I tried hosting tilesets and they are working fine (showing in my cesium viewer) but with the terrain I get an error stating that layer.json and the tiles could not be found.

Does anyone know how to configure nginx to be able to host a terrain ( .terraindb ) and serve it to a cesiumjs application?

I would really appreciate it if anyone could provide some directions or tips.