2018-03-29 18:30:24 +00:00
|
|
|
#!/bin/bash -eux
|
2018-03-31 15:47:15 +00:00
|
|
|
FIRST_HOST=$(echo ${DJANGO_ALLOWED_HOSTS} | cut -d, -f1)
|
2018-03-29 18:30:24 +00:00
|
|
|
echo "Copying template file..."
|
|
|
|
cp /etc/nginx/funkwhale_proxy.conf{.template,}
|
2018-03-31 15:47:15 +00:00
|
|
|
sed -i "s/X-Forwarded-Host \$host:\$server_port/X-Forwarded-Host ${FIRST_HOST}:${WEBPACK_DEVSERVER_PORT}/" /etc/nginx/funkwhale_proxy.conf
|
|
|
|
sed -i "s/proxy_set_header Host \$host/proxy_set_header Host ${FIRST_HOST}/" /etc/nginx/funkwhale_proxy.conf
|
2018-03-29 18:30:24 +00:00
|
|
|
sed -i "s/proxy_set_header X-Forwarded-Port \$server_port/proxy_set_header X-Forwarded-Port ${WEBPACK_DEVSERVER_PORT}/" /etc/nginx/funkwhale_proxy.conf
|
|
|
|
|
|
|
|
cat /etc/nginx/funkwhale_proxy.conf
|
|
|
|
nginx -g "daemon off;"
|