Skip to content

Commit e19c2ea

Browse files
committed
- Fixed FS#2220.
1 parent f0a0ea0 commit e19c2ea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

server/conf/nginx_vhost.conf.master

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ server {
105105
alias /usr/share/awstats/icon;
106106
}
107107

108-
<tmpl_if name='php' op='==' value='php-fpm'>
109108
location ~ \.php$ {
109+
try_files /non_existing_file.htm @php;
110+
}
111+
112+
<tmpl_if name='php' op='==' value='php-fpm'>
113+
location @php {
110114
try_files $uri =404;
111115
include /etc/nginx/fastcgi_params;
112116
<tmpl_if name='use_tcp'>
@@ -121,7 +125,7 @@ server {
121125
fastcgi_intercept_errors on;
122126
}
123127
</tmpl_else>
124-
location ~ \.php$ {
128+
location @php {
125129
deny all;
126130
}
127131
</tmpl_if>
@@ -147,6 +151,10 @@ server {
147151
location <tmpl_var name='htpasswd_location'> { ##merge##
148152
auth_basic "Members Only";
149153
auth_basic_user_file <tmpl_var name='htpasswd_path'>.htpasswd;
154+
155+
location ~ \.php$ {
156+
try_files /non_existing_file.htm @php;
157+
}
150158
}
151159
</tmpl_loop>
152160

0 commit comments

Comments
 (0)