From 8a4151e718e9ee7f5f9a25aab28fdbe318a7f2e6 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 5 Jan 2019 04:54:50 -0700 Subject: [PATCH] subst PHP parameters into buffers configuration --- .vscode/numbered-bookmarks.json | 2 +- etc/nginx/conf.d/buffers_conf_php.insert | 3 +++ etc/nginx/conf.d/buffers_conf_php.option | 7 ------- setup.sh | 7 +++++++ 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 etc/nginx/conf.d/buffers_conf_php.insert delete mode 100644 etc/nginx/conf.d/buffers_conf_php.option diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index ce68d22..084b54b 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -12,7 +12,7 @@ -1, -1, -1, - 537 + 545 ] } ] diff --git a/etc/nginx/conf.d/buffers_conf_php.insert b/etc/nginx/conf.d/buffers_conf_php.insert new file mode 100644 index 0000000..a033120 --- /dev/null +++ b/etc/nginx/conf.d/buffers_conf_php.insert @@ -0,0 +1,3 @@ +fastcgi_buffers 64 64k; +fastcgi_buffer_size 256k; +fastcgi_busy_buffers_size 3840k; diff --git a/etc/nginx/conf.d/buffers_conf_php.option b/etc/nginx/conf.d/buffers_conf_php.option deleted file mode 100644 index d208b02..0000000 --- a/etc/nginx/conf.d/buffers_conf_php.option +++ /dev/null @@ -1,7 +0,0 @@ -### appended by script if PHP option chosen - -fastcgi_buffers 64 64k; -fastcgi_buffer_size 256k; -fastcgi_busy_buffers_size 3840k; - -# for sed -- just append to end of file diff --git a/setup.sh b/setup.sh index 588cb97..939b48b 100644 --- a/setup.sh +++ b/setup.sh @@ -46,6 +46,9 @@ file_ssl="nginx/snippets/ssl/ssl_certs.conf" tag_dhparam="" tag_cachain="" file_mozmodern="nginx/conf.d/mozModern_ssl.conf" +file_buffers="nginx/conf.d/buffers.conf" +file_buffersPHP="nginx/conf.d/buffers_conf_php.insert" + ### quick intro for the user echo -e "\n${mag}This script will customize the provided NGINX template files for your" @@ -540,6 +543,10 @@ echo "updating ${warn}${configPath}/${file_mozmodern}${norm}" sed -i -e "s%${tag_dhparam}%${DHPath}%" "${configPath}/${file_mozmodern}" sed -i -e "s%${tag_cachain}%${CAChainPath}%" "${configPath}/${file_mozmodern}" +# if using PHP: process buffers.conf +if [ ${usePHP} -eq 1 ]; then +echo "updating ${warn}${configPath}/${file_buffers}${norm}" +cat "${configPath}/${file_buffersPHP}" >> "${configPath}/${file_buffers}" # debug section