Block direct access to sensitive files like logs and backups in CodeIgniter 3 by configuring Nginx location blocks to return 403 Forbidden errors.