mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-11-05 18:56:09 +08:00
Support custom PHP server values (#218)
* Add the logic for custom php paths * Add the i18n strings * Fix some visual things
This commit is contained in:
committed by
GitHub
parent
323cae4c50
commit
ad63ca0c8b
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 DigitalOcean
|
||||
Copyright 2021 DigitalOcean
|
||||
|
||||
This code is licensed under the MIT License.
|
||||
You may obtain a copy of the License at
|
||||
@@ -27,6 +27,7 @@ THE SOFTWARE.
|
||||
import sslProfiles from '../../util/ssl_profiles';
|
||||
import websiteConf from './website.conf';
|
||||
import shareQuery from '../../util/share_query';
|
||||
import phpPath from '../../util/php_path';
|
||||
|
||||
export default (domains, global) => {
|
||||
const config = {};
|
||||
@@ -53,8 +54,8 @@ export default (domains, global) => {
|
||||
if (global.php.phpBackupServer.computed)
|
||||
config.http.push(['upstream php', {
|
||||
server: [
|
||||
`${global.php.phpServer.computed[0] === '/' ? 'unix:' : ''}${global.php.phpServer.computed}`,
|
||||
`${global.php.phpBackupServer.computed[0] === '/' ? 'unix:' : ''}${global.php.phpBackupServer.computed} backup`,
|
||||
phpPath(global),
|
||||
`${phpPath(global, true)} backup`,
|
||||
],
|
||||
}]);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 DigitalOcean
|
||||
Copyright 2021 DigitalOcean
|
||||
|
||||
This code is licensed under the MIT License.
|
||||
You may obtain a copy of the License at
|
||||
@@ -24,6 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import phpPath from '../../util/php_path';
|
||||
|
||||
export default (domains, global) => {
|
||||
const legacyRouting = domains.some(d => d.routing.legacyPhpRouting.computed);
|
||||
const config = {};
|
||||
@@ -42,8 +44,7 @@ export default (domains, global) => {
|
||||
|
||||
config['# fastcgi settings'] = '';
|
||||
config.fastcgi_pass = domains.some(d => d.php.php.computed) && global.php.phpBackupServer.computed !== ''
|
||||
? 'php'
|
||||
: ((global.php.phpServer.computed[0] === '/' ? 'unix:' : '') + global.php.phpServer.computed);
|
||||
? 'php' : phpPath(global);
|
||||
config.fastcgi_index = 'index.php';
|
||||
config.fastcgi_buffers = '8 16k';
|
||||
config.fastcgi_buffer_size = '32k';
|
||||
|
||||
Reference in New Issue
Block a user