Skip to content

Commit

Permalink
Avoid PHP_PORT variable name as it conflicts with links: php:php
Browse files Browse the repository at this point in the history
In ECS template we use links: php:php which generate an environment variable
called PHP_PORT (which contain a string like "tcp://172.17.0.4:9000") and this
conflicts with our own "internal" variable.

So we use another name that is non-conflicting.
  • Loading branch information
baschny committed Feb 29, 2024
1 parent 7dbb88c commit 7c8b0f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ set -e

# Export these so that apache can use them in the configuration files directly
export APP_WEBROOT=${APP_WEBROOT:-/app/html}
export PHP_HOSTNAME=${PHP_HOSTNAME:-php}
export PHP_PORT=${PHP_PORT:-9000}
export PHPFPM_HOSTNAME=${PHPFPM_HOSTNAME:-php}
export PHPFPM_PORT=${PHPFPM_PORT:-9000}

# List of ports to listen to, space separated list
WEB_PORTS_HTTP=${WEB_PORTS_HTTP:-80}

echo "* DocumentRoot: $APP_WEBROOT"
echo "* PHP-FPM: $PHP_HOSTNAME:$PHP_PORT"
echo "* PHP-FPM: $PHPFPM_HOSTNAME:$PHPFPM_PORT"

# If env variables SSL_KEY and SSL_CRT are set, configure apache for SSL access
if [ ! -z "$SSL_KEY" ] && [ ! -z "$SSL_CRT" ]; then
Expand Down
2 changes: 1 addition & 1 deletion files/httpd-vhost-ssl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SSLProxyProtocol all -SSLv3

# Handle PHP with PHP-FPM
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://${PHP_HOSTNAME}:${PHP_PORT}"
SetHandler "proxy:fcgi://${PHPFPM_HOSTNAME}:${PHPFPM_PORT}"
</FilesMatch>

# If the php file doesn't exist, disable the proxy handler.
Expand Down
2 changes: 1 addition & 1 deletion files/httpd-vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Handle PHP with PHP-FPM
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://${PHP_HOSTNAME}:${PHP_PORT}"
SetHandler "proxy:fcgi://${PHPFPM_HOSTNAME}:${PHPFPM_PORT}"
</FilesMatch>

# If the php file doesn't exist, disable the proxy handler.
Expand Down

0 comments on commit 7c8b0f7

Please sign in to comment.