Skip to content

Commit 12687f1

Browse files
authored
Merge pull request #31 from spaceonfire/29-nginx-read-timeout
fix(nginx): check `fastcgi_read_timeout` directive not exist before adding
2 parents 2313df8 + e40be2f commit 12687f1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spaceonfire/bin/entrypoint.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ if [[ -z "$NGINX_READ_TIMEOUT" ]] && [[ "$APPLICATION_ENV" != "production" ]]; t
4040
fi
4141

4242
if [[ ! -z "$NGINX_READ_TIMEOUT" ]]; then
43-
{
44-
echo ""
45-
echo "fastcgi_read_timeout $NGINX_READ_TIMEOUT;"
46-
} >> /etc/nginx/fastcgi_params
43+
FastCgiParamsFile="/etc/nginx/fastcgi_params"
44+
if ! grep -q fastcgi_read_timeout "$FastCgiParamsFile"; then
45+
{
46+
echo ""
47+
echo "fastcgi_read_timeout $NGINX_READ_TIMEOUT;"
48+
} >> $FastCgiParamsFile
49+
fi
4750
fi
4851

4952
# Prevent config files from being filled to infinity by force of stop and restart the container

0 commit comments

Comments
 (0)