Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nginx-root.conf.sample #12146

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions admin_manual/installation/nginx-root.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ server {
location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }

# Hide grunt, package files
location ~* (Gruntfile|package)\.(js|json|jsonc)$ {
return 404;
}

# Hide all composer files
location ~* composer\. {
return 404;
}

# Ensure this block, which passes PHP files to the PHP process, is above the blocks
# which handle static assets (as seen below). If this block is not declared first,
# then Nginx will encounter an infinite rewriting loop when it prepends `/index.php`
Expand Down
10 changes: 10 additions & 0 deletions admin_manual/installation/nginx-subdir.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ server {
location ~ ^/nextcloud/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return 404; }
location ~ ^/nextcloud/(?:\.|autotest|occ|issue|indie|db_|console) { return 404; }

# Hide grunt, package files
location ~* (Gruntfile|package)\.(js|json|jsonc)$ {
return 404;
}

# Hide all composer files
location ~* composer\. {
return 404;
}

# Ensure this block, which passes PHP files to the PHP process, is above the blocks
# which handle static assets (as seen below). If this block is not declared first,
# then Nginx will encounter an infinite rewriting loop when it prepends
Expand Down