legacy PHP routing, fast_cgi fixes

This commit is contained in:
Szekeres Bálint
2018-12-18 23:26:57 +01:00
parent 1191637cc6
commit c25228ef53
5 changed files with 36 additions and 15 deletions

View File

@@ -1,17 +1,26 @@
<!--
✔ Legacy PHP routing --><span ng-if="isLegacyPHPRouting()"><!--
--># split path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
set $_fastcgi_path_info $fastcgi_path_info;
</span><!--
--># 404
try_files $fastcgi_script_name =404;
# default fastcgi_params
include fastcgi_params;
# fastcgi settings
fastcgi_pass {{ !isPHPBackup() ? ((data.php_server[0] === '/' ? 'unix:' : '') + data.php_server) : 'php' }};
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass {{ !isPHPBackup() ? ((data.php_server[0] === '/' ? 'unix:' : '') + data.php_server) : 'php' }};
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
# fastcgi params
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;<!--
✔ Legacy PHP routing --><span ng-if="isLegacyPHPRouting()">
fastcgi_param PATH_INFO $_fastcgi_path_info;</span>
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$base/:/usr/lib/php/:/tmp/";
fastcgi_intercept_errors off;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;

View File

@@ -1,6 +1,5 @@
# WordPress: allow TinyMCE
location = /wp-includes/js/tinymce/wp-tinymce.php {
try_files $uri =404;
include nginxconfig.io/php_fastcgi.conf;
}
@@ -32,6 +31,5 @@ location ~* ^/(?:xmlrpc\.php|wp-links-opml\.php|wp-config\.php|wp-config-sample\
# WordPress: throttle wp-login.php
location = /wp-login.php {
limit_req zone=login burst=2 nodelay;
try_files $uri =404;
include nginxconfig.io/php_fastcgi.conf;
}</span>

View File

@@ -85,14 +85,12 @@ server {<!--
✔ PHP --><span ng-if="isPHP()">
# handle .php
location ~ \.php$ {
try_files $uri =404;<!--
location ~ {{ isLegacyPHPRouting() ? '[^/]\\.php(/|$)' : '\\.php$' }} {<!--
✔ modularized || ✔ WordPress --><span ng-if="isModularized() || isWordPress()">
include nginxconfig.io/php_fastcgi.conf;</span><!--
✔ unified && ✘ WordPress --><span ng-if="isUnified() && !isWordPress()">
<ng-include ng-include-tabs="{{ isUnified() ? 3 : 1 }}" src="'templates/conf/nginxconfig.io/php_fastcgi.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
}</span><!--