mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 14:39:16 +02:00
17 lines
786 B
Bash
Executable file
17 lines
786 B
Bash
Executable file
#!/bin/bash -eux
|
|
|
|
FORWARDED_PORT="$WEBPACK_DEVSERVER_PORT"
|
|
COMPOSE_PROJECT_NAME="${COMPOSE_PROJECT_NAME// /}"
|
|
if [ -n "$COMPOSE_PROJECT_NAME" ]; then
|
|
echo
|
|
FUNKWHALE_HOSTNAME="$COMPOSE_PROJECT_NAME.funkwhale.test"
|
|
FORWARDED_PORT="443"
|
|
fi
|
|
echo "Copying template file..."
|
|
cp /etc/nginx/funkwhale_proxy.conf{.template,}
|
|
sed -i "s/X-Forwarded-Host \$host:\$server_port/X-Forwarded-Host ${FUNKWHALE_HOSTNAME}:${FORWARDED_PORT}/" /etc/nginx/funkwhale_proxy.conf
|
|
sed -i "s/proxy_set_header Host \$host/proxy_set_header Host ${FUNKWHALE_HOSTNAME}/" /etc/nginx/funkwhale_proxy.conf
|
|
sed -i "s/proxy_set_header X-Forwarded-Port \$server_port/proxy_set_header X-Forwarded-Port ${FORWARDED_PORT}/" /etc/nginx/funkwhale_proxy.conf
|
|
|
|
cat /etc/nginx/funkwhale_proxy.conf
|
|
nginx -g "daemon off;"
|