What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Apache: disable generated listings with Options -Indexes in the most specific applicable <Directory>, virtual-host, or .htaccess context. Remove Indexes from an inherited Options line if that is how listing was enabled. NGINX: add autoindex off; to the applicable http, server, or location block. Then validate, reload the server, and request a directory that has no index file to confirm that no generated file list appears.

What directory listing is—and why it appears

A directory URL normally resolves to an index document such as index.html or an application entry point. When the server cannot find a suitable index file, it may generate an HTML page containing the directory’s files and subdirectories. The behavior is controlled by different directives in Apache HTTP Server and NGINX.

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

Apache’s mod_autoindex generates the listing when the Indexes option is enabled. Apache documentation describes automatic index generation as being enabled with Options +Indexes. NGINX uses ngx_http_autoindex_module; its autoindex directive is off by default and can be enabled in an applicable context.

A listing can disclose names, backup files, upload folders, software artifacts, and directory structure. Turning listings off reduces that exposure, but it is not an access-control mechanism: a person who knows a direct URL may still retrieve a file when permissions and routing allow it.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Quick answers to the common questions

  • How do I disable directory listing on Apache? Put Options -Indexes in the most specific applicable <Directory>, virtual-host, or permitted .htaccess context. You can also remove the Indexes keyword from an inherited Options line.
  • How do I turn off autoindex in NGINX? Add autoindex off; in the relevant http, server, or location block, then validate and reload.
  • Why do I see “Index of” instead of my website? The requested directory has no matching index file, and automatic listing is enabled for that request. Check the expected index name as well as the listing directive.
  • Where do these directives go? Put each directive where the request is actually handled, not merely in a file that looks related. More-specific Apache directory contexts and NGINX locations can override broader settings.

Apache: disable automatic directory indexes

1. Identify the configuration that applies

Find the setting for the directory that is showing the listing. Depending on how Apache is deployed, it may be in:

  • the virtual host configuration;
  • an Apache <Directory> section;
  • a per-directory .htaccess file; or
  • an inherited Options directive in a broader configuration section.

Apache configuration specificity matters. A setting in a more-specific section or directory context can override a broader setting, so changing a global line may have no visible effect on the affected path. Work from the URL that exposes the listing back to the document root and virtual-host rules that serve it. Confirm that the filesystem path in the <Directory> block is the path Apache actually maps to that URL.

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

Do not confuse a URL path with a filesystem path. The request /downloads/ could map to a directory under a document root, an alias, or another virtual-host rule. The disabling directive must apply to the resulting directory context.

2. Turn off the Indexes option

In the most specific applicable context, use:

Options -Indexes

For example, a virtual-host or server configuration can contain:

<Directory /var/www/site/public/files>
    Options -Indexes
</Directory>

If the existing line enables several options, remove only the Indexes keyword while retaining the options the application needs:

Options FollowSymLinks -Indexes

The important result is that Indexes is no longer enabled for the directory. Apache’s FAQ describes the same fix as removing the Indexes keyword from the appropriate Options line and gives Options -Indexes as the per-directory form.

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

Use the minus sign deliberately. Options Indexes or Options +Indexes enables automatic index generation; Options -Indexes disables it while allowing other options on the same line to remain in effect.

3. Apply the change in .htaccess when permitted

When you do not control the virtual-host configuration but overrides are enabled for the site directory, create or edit the applicable .htaccess file:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
Options -Indexes

Place it in the directory whose contents should not be listed, or in a parent directory when that inheritance is intentional. If Apache rejects the directive with a server error, the host may not allow this option in .htaccess; move the change to the virtual-host or <Directory> configuration instead.

A parent .htaccess can affect child directories, while a child file can make a narrower exception. Review the complete chain rather than assuming the nearest file is the only setting. If a hosting control panel writes Apache configuration for you, make the change through that panel or ask the provider to place it in the active context.

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

4. Keep a deliberate index file

Disabling listings does not create a home page. Set an appropriate DirectoryIndex, such as:

DirectoryIndex index.html

Use the application’s normal entry point when the directory is served by a framework or another front controller. Apache first looks for a matching DirectoryIndex. If none is found and Indexes remains enabled, mod_autoindex can return a formatted listing. With Indexes disabled, that fallback listing is not generated.

Check the actual filename and capitalization used on the server. A directory can contain an index document that is not one of the names configured in DirectoryIndex; in that case Apache behaves as though no index exists and proceeds to its fallback behavior.

5. Validate, reload, and test Apache

  1. Save the configuration in the file that actually serves the URL.
  2. Run the configuration-validation command provided by your Apache package or deployment process. Fix every syntax or include error before reloading.
  3. Reload Apache using your operating system or service manager’s normal procedure so workers read the new configuration.
  4. Request a directory that intentionally has no index file, preferably with a trailing slash. Confirm that Apache no longer returns a generated list. The resulting response may be an application response or an access/error response, depending on the rest of the site configuration; the key check is that the auto-generated listing is gone.
  5. Request the intended index URL and verify that the site’s normal entry point still works.

A configuration test that fails should stop the rollout: a reload may be refused, leaving the previous configuration active. Check the reload result, not just the fact that the file was saved. Test the exact hostname, port, and URL used by visitors so another virtual host or listener does not mislead you.

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

Apache example: protect a downloads directory while preserving the site index

<VirtualHost *:80>
    DocumentRoot /var/www/site/public

    <Directory /var/www/site/public>
        DirectoryIndex index.html
        Options FollowSymLinks -Indexes
    </Directory>

    <Directory /var/www/site/public/downloads>
        Options -Indexes
    </Directory>
</VirtualHost>

The more-specific downloads section makes the intent clear even if a parent section changes later. Do not copy the surrounding virtual-host settings blindly; adapt the paths and options to the existing deployment.

NGINX: turn off autoindex

1. Find the active server and location

Start with the virtual server that answers the hostname, then identify the location serving the static directory. A request can be handled by a more-specific location than the one you first inspect, so trace the actual URI and included configuration files.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

For example, a broad location / does not tell you whether a nested assets or downloads location takes precedence. Inspect all relevant blocks and the files they include. The setting must be applied to the block selected for the request.

2. Add autoindex off; at the right scope

The directive is valid in http, server, and location contexts:

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

For a site-wide default, it can be placed in the http block. A server-level setting limits the behavior to one virtual server. A location-level setting is the narrowest choice when only one directory needs protection:

server {
    listen 80;
    server_name example.test;
    root /var/www/site/public;
    index index.html;

    location /downloads/ {
        autoindex off;
    }
}

NGINX documents autoindex on | off; and lists these three contexts. Because the documented default is off, an unexpected listing usually means an included file or a more-specific location explicitly enables autoindex on;.

Setting autoindex off; at a broad level is useful as a safe baseline, while a location-level declaration records the security intent next to the protected path. Avoid assuming that placing the line later in a file automatically wins; location selection and configuration inheritance determine which value is effective.

3. Confirm index processing

NGINX’s autoindex module is used for slash-terminated requests when the index module cannot find an index file. Keep an appropriate index directive where the directory should serve a page:

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

Turning autoindex off prevents the generated fallback; it does not substitute for an index file and does not block direct requests for known files. A request without the trailing slash may be redirected or handled differently, so test the canonical slash-terminated directory URL as well as links that lead to it.

4. Validate, reload, and test NGINX

  1. Save the active configuration and confirm that the edited file is included by the running NGINX instance.
  2. Run the configuration-test command supplied by your NGINX installation or deployment process. Correct syntax and include-path errors before proceeding.
  3. Reload NGINX through the normal service-management or deployment workflow.
  4. Request the affected directory with a trailing slash while no index file is present. Verify that NGINX does not return an automatically generated listing.
  5. Request the intended index document and a known static file to ensure that normal content delivery remains intact.

If validation or reload fails, NGINX continues serving with its prior working configuration. Record the result of both operations and repeat the test only after a successful reload. Test the hostname that selects the intended server block; a default server can otherwise make a correct edit appear ineffective.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

NGINX example: disable listings only for one static path

http {
    include mime.types;

    server {
        listen 80;
        server_name example.test;
        root /srv/www/public;
        index index.html;

        location /assets/ {
            autoindex off;
        }
    }
}

If another, more-specific location for a nested path contains autoindex on;, that block must be changed as well. Inspect the complete loaded configuration rather than assuming the first matching-looking block is the one in use.

Apache and NGINX compared

Aspect Apache HTTP Server NGINX
Primary switch Options -Indexes, or remove Indexes from an inherited Options line autoindex off;
Listing component mod_autoindex ngx_http_autoindex_module
Contexts to inspect <Directory>, virtual host, .htaccess, and inherited Options http, server, and location
Index fallback DirectoryIndex is tried; mod_autoindex can list files when Indexes is enabled and no index matches The index module is tried; autoindex can list files for a slash-terminated request when enabled and no index is found
Common reason a change appears ineffective A more-specific section or per-directory setting still enables Indexes A more-specific location or included file still enables autoindex on;

The practical distinction is scope syntax. Apache administrators usually trace directory and option inheritance, while NGINX administrators trace virtual servers, locations, and included files. In both systems, the safest workflow is the same: identify the request path, find the most specific active rule, disable generation there, validate, reload, and test a directory with no index file.

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

Troubleshooting when a listing still appears

Apache still shows an index of files

  • Wrong scope: the edited .htaccess or <Directory> block may not correspond to the document path serving the request. Check the virtual host and filesystem mapping.
  • More-specific options: another section may re-enable Indexes. Apache’s configuration rules allow more-specific settings to override broader ones; place the disabling directive in the applicable specific context.
  • Reload not completed: a saved file does not affect running workers until the service is successfully reloaded.
  • Another server answered: a reverse proxy, alternate virtual host, or different listener may be returning the page. Confirm the hostname, port, and active server configuration.
  • It is an application page: a framework or file manager may generate its own listing. Options -Indexes only controls Apache’s automatic index generation.
  • An index name is wrong: verify that DirectoryIndex names the file that actually exists. Otherwise Apache may legitimately continue to its fallback handling.

NGINX still shows a listing

  • More-specific location: inspect nested and regular-expression locations for autoindex on;.
  • Included configuration: the active file may include a fragment that changes the setting after the line you edited.
  • Wrong server block: the request’s hostname or port may select a different server block.
  • Reload failed: always check the configuration-test result and reload status; NGINX continues using the prior configuration after a failed reload.
  • Application-generated content: a script or upstream service can produce a file list independently of NGINX’s autoindex module.
  • Request shape: autoindex behavior is associated with slash-terminated directory requests. Test the canonical URL and inspect redirects before drawing a conclusion.

Verification checklist

  • Identify the exact URL and filesystem directory that produced the listing.
  • Check whether an index file is expected and whether DirectoryIndex or index names it.
  • Apply the server-specific directive in the most specific valid context.
  • Search included configuration for another directive that enables listing.
  • Validate syntax before reloading.
  • Reload through the normal service process and confirm it succeeded.
  • Test a directory with no index file and verify that no generated listing is returned.
  • Test the normal index URL and a permitted direct file URL.
  • Review access controls separately; disabling listings does not make files private.
  • Repeat the test through the same hostname, port, proxy path, and deployment stage used by real traffic.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Security and operational limits

Directory listings reveal metadata that may help visitors map an application or discover files that were not intended for casual browsing. Disabling automatic generation is a sensible hardening step, especially for upload, backup, and build-artifact directories.

It does not replace authentication, authorization, filesystem permissions, or rules that prevent sensitive files from being served. A direct URL can remain reachable after listings are disabled. Remove sensitive files from the web root or enforce access controls when confidentiality matters.

Finally, test the change in the same path, virtual host, and deployment stage used by real traffic. A directive in an unused configuration file, a failed reload, or a proxy serving cached content can make a correct edit appear ineffective.

Frequently asked questions

Will disabling indexes break my website?

It should not break a directory that has a valid configured index or an application route. It does mean that a directory with no index file will no longer fall back to a generated file list. Test the normal entry point and any intended direct file URLs after reloading.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Should I use Options -Indexes or remove Indexes?

Both express the same goal. Use Options -Indexes when you want an explicit per-directory setting. If an existing Options line combines several keywords, remove only Indexes so required options remain enabled.

Is NGINX autoindex already disabled?

The documented default for NGINX’s autoindex directive is off. If a listing appears, inspect included files and more-specific locations for an explicit autoindex on;, and confirm that an application is not generating the page itself.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

What response should I expect after disabling a listing?

There is no single required replacement response. Depending on the rest of the configuration, a directory without an index may produce an application response or an access/error response. The relevant verification is that the server no longer returns its automatically generated file list.

Does this protect files from someone who knows the URL?

No. Listing suppression hides the directory map; it does not remove direct-file access. Use authentication, authorization, filesystem permissions, or rules that keep sensitive material outside the web root.

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

Can a reverse proxy or application bypass this setting?

Yes. A different listener, virtual host, proxy, framework, or file manager may answer the request or generate its own listing. Verify which component returned the response and apply controls at that layer as well.

Where should a hosting customer make the change?

Use .htaccess only when the host permits the required override. Otherwise the provider must change the virtual-host or directory configuration. A managed Apache/NGINX host can make this practical when you cannot edit the active server files, but confirm the provider’s scope and terms.

Do I need to disable listings everywhere?

Apply the setting to every directory where generated listings are not intentional, with particular attention to uploads, backups, downloads, and build artifacts. A narrow location or directory rule is appropriate when other parts of the site deliberately require different behavior.

Frequently Asked Questions

How do I disable directory listing on Apache?

Use Options -Indexes in the most specific applicable <Directory>, virtual-host, or permitted .htaccess context. Alternatively, remove Indexes from the inherited Options line.

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

How do I turn off autoindex in NGINX?

Add autoindex off; in the applicable http, server, or location block, validate the configuration, reload NGINX, and test a directory with no index file.

Why is an index of files still appearing?

Check configuration scope, included files, more-specific Apache sections or NGINX locations, reload status, the selected hostname and port, and whether an application—not the web server—is generating the listing.

Does disabling directory listing make files private?

No. It prevents automatic directory maps but does not block a known direct URL. Use authentication, authorization, permissions, or keep sensitive files outside the web root.

The Bottom Line

For Apache, disable the Indexes option with Options -Indexes (or remove Indexes from an inherited options line) in the most specific directory context. For NGINX, set autoindex off; in the active http, server, or location context. Keep the intended DirectoryIndex or index file, validate and reload successfully, then test a slash-terminated directory that has no index. If a list remains, trace scope, includes, virtual-host or location selection, and application-generated responses; remember that hiding listings is not the same as protecting files.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

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.