Skip to content

Commit 8f5bb8d

Browse files
author
Till Brehm
committed
Merge branch 'fpm-apache-vhost-fix' into 'stable-3.1'
Fixed error 404 when PHP-FPM is used and PHP script does not exists. See merge request ispconfig/ispconfig3!990
2 parents e845b8e + 1811e64 commit 8f5bb8d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

server/conf/vhost.conf.master

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,16 @@
372372
</Directory>
373373
<Directory {tmpl_var name='web_document_root_www'}>
374374
<FilesMatch "\.php[345]?$">
375-
SetHandler php-fcgi
375+
<If "-f '%{REQUEST_FILENAME}'">
376+
SetHandler php-fcgi
377+
</If>
376378
</FilesMatch>
377379
</Directory>
378380
<Directory {tmpl_var name='web_document_root'}>
379381
<FilesMatch "\.php[345]?$">
380-
SetHandler php-fcgi
382+
<If "-f '%{REQUEST_FILENAME}'">
383+
SetHandler php-fcgi
384+
</If>
381385
</FilesMatch>
382386
</Directory>
383387
Action php-fcgi /php-fcgi virtual
@@ -402,15 +406,19 @@
402406
#ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:<tmpl_var name='fpm_port'><tmpl_var name='web_document_root'>/$1
403407
<Directory {tmpl_var name='web_document_root'}>
404408
<FilesMatch "\.php[345]?$">
409+
<If "-f '%{REQUEST_FILENAME}'">
405410
SetHandler "proxy:fcgi://127.0.0.1:<tmpl_var name='fpm_port'>"
411+
</If>
406412
</FilesMatch>
407413
</Directory>
408414
</tmpl_if>
409415
<tmpl_if name='use_socket'>
410416
#ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix://<tmpl_var name='fpm_socket'>|fcgi://localhost/<tmpl_var name='web_document_root'>/$1
411417
<Directory {tmpl_var name='web_document_root'}>
412418
<FilesMatch "\.php[345]?$">
419+
<If "-f '%{REQUEST_FILENAME}'">
413420
SetHandler "proxy:unix:<tmpl_var name='fpm_socket'>|fcgi://localhost"
421+
</If>
414422
</FilesMatch>
415423
</Directory>
416424
</tmpl_if>

0 commit comments

Comments
 (0)