Skip to content

Commit a2ce6ca

Browse files
authored
Merge pull request hestiacp#1592 from hestiacp/security/1589-hide-hidden-files
Hide hidden files by default
2 parents fd0a96b + d42a164 commit a2ce6ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+138
-140
lines changed

install/deb/templates/web/nginx/php-fpm/cms_made_simple.stpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ server {
4444
alias %home%/%user%/web/%domain%/document_errors/;
4545
}
4646

47-
location ~* "/\.(htaccess|htpasswd)$" {
48-
deny all;
49-
return 404;
47+
location ~ /\.(?!well-known\/) {
48+
deny all;
49+
return 404;
5050
}
51-
5251
location /vstats/ {
5352
alias %home%/%user%/web/%domain%/stats/;
5453
include %home%/%user%/web/%domain%/stats/auth.conf*;

install/deb/templates/web/nginx/php-fpm/cms_made_simple.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ server {
3939
alias %home%/%user%/web/%domain%/document_errors/;
4040
}
4141

42-
location ~* "/\.(htaccess|htpasswd)$" {
43-
deny all;
44-
return 404;
42+
location ~ /\.(?!well-known\/) {
43+
deny all;
44+
return 404;
4545
}
4646

4747
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/codeigniter2.stpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ server {
4949
alias %home%/%user%/web/%domain%/document_errors/;
5050
}
5151

52-
location ~* "/\.(htaccess|htpasswd)$" {
53-
deny all;
54-
return 404;
52+
location ~ /\.(?!well-known\/) {
53+
deny all;
54+
return 404;
5555
}
5656

5757
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/codeigniter2.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ server {
4444
alias %home%/%user%/web/%domain%/document_errors/;
4545
}
4646

47-
location ~* "/\.(htaccess|htpasswd)$" {
48-
deny all;
49-
return 404;
47+
location ~ /\.(?!well-known\/) {
48+
deny all;
49+
return 404;
5050
}
5151

5252
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/codeigniter3.stpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ server {
4444
alias %home%/%user%/web/%domain%/document_errors/;
4545
}
4646

47-
location ~* "/\.(htaccess|htpasswd)$" {
48-
deny all;
49-
return 404;
50-
}
47+
location ~ /\.(?!well-known\/) {
48+
deny all;
49+
return 404;
50+
}
5151

5252
location /vstats/ {
5353
alias %home%/%user%/web/%domain%/stats/;

install/deb/templates/web/nginx/php-fpm/codeigniter3.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ server {
4040
alias %home%/%user%/web/%domain%/document_errors/;
4141
}
4242

43-
location ~* "/\.(htaccess|htpasswd)$" {
44-
deny all;
45-
return 404;
43+
location ~ /\.(?!well-known\/) {
44+
deny all;
45+
return 404;
4646
}
4747

4848
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/datalife_engine.stpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ server {
115115
alias %home%/%user%/web/%domain%/document_errors/;
116116
}
117117

118-
location ~* "/\.(htaccess|htpasswd)$" {
119-
deny all;
120-
return 404;
118+
location ~ /\.(?!well-known\/) {
119+
deny all;
120+
return 404;
121121
}
122122

123123
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/datalife_engine.tpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
#=======================================================================#
1+
location ~ /\.(?!well-known\/) {
2+
deny all;
3+
return 404;
4+
}#=======================================================================#
25
# Default Web Domain Template #
36
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
47
#=======================================================================#
@@ -110,9 +113,9 @@ server {
110113
alias %home%/%user%/web/%domain%/document_errors/;
111114
}
112115

113-
location ~* "/\.(htaccess|htpasswd)$" {
114-
deny all;
115-
return 404;
116+
location ~ /\.(?!well-known\/) {
117+
deny all;
118+
return 404;
116119
}
117120

118121
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/default.stpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ server {
4343
alias %home%/%user%/web/%domain%/document_errors/;
4444
}
4545

46-
location ~* "/\.(htaccess|htpasswd)$" {
47-
deny all;
48-
return 404;
46+
location ~ /\.(?!well-known\/) {
47+
deny all;
48+
return 404;
4949
}
5050

5151
location /vstats/ {

install/deb/templates/web/nginx/php-fpm/default.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ server {
3838
alias %home%/%user%/web/%domain%/document_errors/;
3939
}
4040

41-
location ~* "/\.(htaccess|htpasswd)$" {
42-
deny all;
43-
return 404;
41+
location ~ /\.(?!well-known\/) {
42+
deny all;
43+
return 404;
4444
}
4545

4646
location /vstats/ {

0 commit comments

Comments
 (0)