October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Why Your Web Server Is Showing Your Build Folder—and How to Fix It

A folder listing can indicate an overly broad web root, enabled directory indexing, or both. Learn how to diagnose the mapping and listing settings in NGINX and Apache.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If your website displays a list of files from a build or project folder, check two separate settings: the server’s URL-to-filesystem mapping and whether directory listings are enabled. The mapping determines which files public URLs can reach; the listing setting determines whether a directory without a usable index file is displayed as a list. Turning listings off does not fix an overly broad web root.

Why a website shows a folder listing

A web server translates a requested URL into a filesystem location using its active site configuration. If that mapping points to a build or project directory, the server may be able to serve files from there. When someone requests a directory and the server cannot find an applicable index file, it may show a listing if directory indexing is permitted.

As an Amazon Associate I earn from qualifying purchases.

These are related but distinct issues. The web root or location mapping controls which files a URL can reach. The directory-index setting controls whether a directory request can reveal its contents as a list. A listing can reveal filenames and folder structure, but seeing a listing alone does not establish that sensitive files were exposed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diagnose the effective configuration

  1. Identify the server and active site. Determine whether the request is handled by NGINX, Apache, or another server, and which virtual host or site configuration applies.
  2. Trace the URL to disk. Work out which filesystem directory the requested URL resolves to under the active mapping. In NGINX, inspect the applicable root or alias; in Apache, check the document root and URL mapping.
  3. Check for an index file. Confirm whether the requested directory contains an intended index file and whether its name is among the index filenames configured for that server and scope.
  4. Check listing permissions. Look for NGINX autoindex in the matching location, or Apache’s mod_autoindex and applicable Options settings.
  5. Review configuration scope. A more specific location, directory, or virtual-host rule may change the behavior. Check the effective rule for the exact URL rather than relying on a setting elsewhere in the configuration.

What to check in NGINX

NGINX uses root or alias to determine the filesystem path for a request, and index to specify which index files to try for a directory request. Its documentation explains that a URI ending in a slash prompts an index-file lookup; if the applicable location has autoindex on, NGINX can instead return an automatically generated listing. See the NGINX guide to serving static content.

Check the mapping and listing rule independently. If the configured root points to a project directory that should not be public, correct the mapping so requests resolve only to the intended public files. If listings are not an intentional site feature, disable them in the applicable location. Do not assume that turning off autoindex makes every file under the configured root unreachable.

What to check in Apache

Apache also maps requested URLs to filesystem locations and may try a directory index. If mod_autoindex is loaded and the applicable directory options permit it, Apache can generate a listing when there is no usable index. Apache’s documentation describes Options -Indexes as a way to turn off listings for a directory; the exact effect depends on the configuration scope. See the Apache mod_autoindex documentation and its Options directive reference.

As with NGINX, disabling listings and correcting the document root are different changes. Make sure the document root and URL mappings expose only the intended public content, then turn off directory listings wherever they are not needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Fix the exposure and verify the result

  • Set the public root or mapping to the directory intended for web serving, not a broader project or build directory containing files that should not be public.
  • Disable automatic directory listings unless the site deliberately needs them: use the applicable NGINX autoindex setting or Apache Options -Indexes.
  • Check the deployed directory itself. Keep its contents limited to public assets; a safer listing setting cannot protect a sensitive file that remains directly reachable through a URL.
  • After applying the change using the method appropriate to your server and host, request the same public URL again and confirm that it serves the intended page or content rather than a directory list.

GitLab’s DAST guidance on directory listing and a U.S. government-hosted guide to securing public web servers also recommend checking configuration for unintended listings. If you find a sensitive file that may have been accessible, assess that exposure separately; the existence of a listing does not show by itself what was accessed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.