Skip to content

Commit

Permalink
PHRAS-3904 Add server port on fastcgi https conf (#4370)
Browse files Browse the repository at this point in the history
* Update entrypoint.sh

* Update entrypoint.sh

* enhance GATEWAY_FASTCGI_HTTPS management script

---------

Co-authored-by: Gaspard Jacobson <[email protected]>
  • Loading branch information
moctardiouf and gjacobjn authored Sep 7, 2023
1 parent 06193f2 commit 4326bc7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docker/nginx/root/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ else
fi

if [ ! -z "$GATEWAY_FASTCGI_HTTPS" ]; then

echo "GATEWAY_FASTCGI_HTTPS is defined : $GATEWAY_FASTCGI_HTTPS"
GATEWAY_FASTCGI_HTTPS="fastcgi_param HTTPS $GATEWAY_FASTCGI_HTTPS;"
if [ "$GATEWAY_FASTCGI_HTTPS" = "on" ] || [ "$GATEWAY_FASTCGI_HTTPS" = "1" ];then
echo "SETTING SERVER_PORT TO: 443"
GATEWAY_FASTCGI_HTTPS="fastcgi_param HTTPS on;fastcgi_param SERVER_PORT 443;"
else
GATEWAY_FASTCGI_HTTPS="fastcgi_param HTTPS $GATEWAY_FASTCGI_HTTPS;"
fi
else
echo "NO GATEWAY_FASTCGI_HTTPS is defined"
GATEWAY_FASTCGI_HTTPS="fastcgi_param HTTPS on;fastcgi_param SERVER_PORT 443;"

fi

cat /nginx.conf.sample | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" | sed "s/\$GATEWAY_SEND_TIMEOUT/$GATEWAY_SEND_TIMEOUT/g" | sed "s/\$GATEWAY_FASTCGI_TIMEOUT/$GATEWAY_FASTCGI_TIMEOUT/g" | sed "s/\$MAX_BODY_SIZE/$MAX_BODY_SIZE/g" | sed "s/\$GATEWAY_PROXY_TIMEOUT/$GATEWAY_PROXY_TIMEOUT/g" | sed "s/\$NEW_TARGET/$NEW_TARGET/g" | sed "s/\$NEW_RESOLVER/$NEW_RESOLVER/g" | sed "s/\$GATEWAY_FASTCGI_HTTPS/$GATEWAY_FASTCGI_HTTPS/g" > /etc/nginx/conf.d/default.conf
Expand Down

0 comments on commit 4326bc7

Please sign in to comment.