server { listen 443 ssl; server_name <>; # SSL certificates ssl_certificate <>/fullchain.pem; ssl_certificate_key <>/privkey.pem; # Default root root <>; # Autoindex for the main folder location / { autoindex on; autoindex_exact_size off; # optional: show human-readable sizes autoindex_localtime on; # optional: show local time # Add custom CSS & JS to autoindex pages sub_filter '' ''; sub_filter '' ''; sub_filter_once on; } # Serve the assets from a separate folder location = /autoindex.css { root <>; } location = /autoindex.js { root <>; } location = /favicon.ico { root <>; } } server { listen 80; server_name <>; return 301 https://<>$request_uri; }