File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments