Skip to content

Commit

Permalink
Fix Server name and Discard varnish from API-Platform configuration i…
Browse files Browse the repository at this point in the history
…n Platformsh until supported
  • Loading branch information
romainruaud authored and PierreGauthier committed Jul 23, 2024
1 parent 41a566d commit d2c80d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .platform/applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@
"/var/sessions": "shared:files/sessions"

# The hooks that will be performed when the package is deployed.
# Remove the last two lines when Varnish will be supported on PSH.
hooks:
build: |
build: |
bin/console lexik:jwt:generate-keypair --skip-if-exists --no-interaction
bin/console --env=prod assets:install --no-debug
Expand Down
5 changes: 3 additions & 2 deletions api/.environment
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ export DATABASE_URL=$DB_SCHEME://$DB_USERNAME:$DB_PASSWORD@$DB_HOST:$DB_PORT/mai
# Set environment variables for Redis
export REDIS_SERVER=$(echo $PLATFORM_RELATIONSHIPS | base64 --decode | jq -r ".redis[0].host")

export TRUSTED_HOSTS=^$PLATFORM_ENVIRONMENT-$PLATFORM_PROJECT.eu.platformsh.site$
export SERVER_NAME=$PLATFORM_ENVIRONMENT-$PLATFORM_PROJECT.eu.platformsh.site
export TRUSTED_HOSTS=^$(echo $PLATFORM_ROUTES | base64 --decode | jq -r "keys[0]" | awk -F[/:] '{print $4}')$
export SERVER_NAME=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r "keys[0]" | awk -F[/:] '{print $4}')
export VARNISH_URL=$(echo $PLATFORM_ROUTES | base64 --decode | jq -r "keys[0]" | awk -F[/:] '{print $4}')

0 comments on commit d2c80d7

Please sign in to comment.