root /var/www/pelican/output/; location {LOCATION} { alias {DESTDIR}/output; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } try_files $uri.html $uri/; # Deny access to hidden files and directories location ~ ^{PATH}/(.+/|)\.(?!well-known\/) { deny all; } }