Skip to content

Commit

Permalink
Allow .well-known folder on Nginx
Browse files Browse the repository at this point in the history
Updated the Nginx configuration to explicitly allow access to the `.well-known` directory while maintaining the restriction for other hidden files and directories (e.g., `.htaccess`, `.htpasswd`).

The `.well-known` directory is commonly used for domain verification and other standards-compliant purposes (e.g., Apple Pay’s `apple-developer-merchantid-domain-association` file). This change ensures that legitimate requests to `.well-known` resources are served while keeping other hidden files secure.

Steps to Verify:
1. Place a test file (e.g., `.well-known/test-file`) in the web root.
2. Verify that the file is accessible at `http://yourdomain.com/.well-known/test-file`.
3. Confirm that other hidden files (e.g., `.htaccess`) remain inaccessible.

Changes Made:
- Modified the existing `location ~ /\.` block to ensure `.well-known` is accessible.
- The updated configuration maintains the deny rule for all other hidden files and directories, preserving security.
  • Loading branch information
Matt75 authored Jan 8, 2025
1 parent b3d4406 commit 34d214b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion basics/installation/advanced/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ server {
# .htaccess, .DS_Store, .htpasswd, etc.
location ~ /\. {
location ~ /\.(?!well-known) {
deny all;
}
Expand Down

0 comments on commit 34d214b

Please sign in to comment.