#Example config for the index location ~ /downloads(.*)/$ { autoindex on; #Send the data in JSON autoindex_format json; addition_types application/json; #Calling from SERVERNAME/autoindex/* add_before_body /autoindex/header.html; add_after_body /autoindex/footer.html; #Need to tell that we are sending HTML add_header Content-Type text/html; }