diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 78bd0a8d..e357c3f0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -25,7 +25,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP echo "Configuring Redis as session handler" { echo 'session.save_handler = redis' - echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + if [ "${REDIS_HOST_PORT:-0}" -eq 0 ]; then + echo "session.save_path = \"unix://${REDIS_HOST}?persistent=1&weight=1&database=0\"" + else + echo "session.save_path = \"tcp://${REDIS_HOST}:${REDIS_HOST_PORT:=6379}\"" + fi } > /usr/local/etc/php/conf.d/redis-session.ini fi