forked from switnet/quick-jibri-installer
announce if mapping is being set or applied.
This commit is contained in:
parent
7a93ca1905
commit
d2899a6abd
|
@ -179,6 +179,7 @@ while [ $secs -gt 0 ]; do
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f "$WS_CONF" ]; then
|
if [ -f "$WS_CONF" ]; then
|
||||||
|
echo "> Setting up webserver configuration file..."
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ # Proxy Grafana." "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ # Proxy Grafana." "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ location ~ ^/(grafana/|grafana/login) {" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ location ~ ^/(grafana/|grafana/login) {" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
||||||
|
@ -193,15 +194,16 @@ if [ -f "$WS_CONF" ]; then
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_set_header Host \$host;" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_pass http://grafana;" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ \ \ proxy_pass http://grafana;" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH1/i \ \ \ \ }" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \ \ \ \ }" "$WS_CONF"
|
||||||
|
|
||||||
if ! grep -q 'map $http_upgrade $connection_upgrade' "$WS_CONF"; then
|
if ! grep -q 'map $http_upgrade $connection_upgrade' "$WS_CONF"; then
|
||||||
|
echo " > Setting mapping upgrade connection."
|
||||||
sed -i "/$WS_MATCH2/i # This is required to proxy Grafana Live WebSocket connections or Etherpad" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i # This is required to proxy Grafana Live WebSocket connections or Etherpad" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i map \$http_upgrade \$connection_upgrade {" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i map \$http_upgrade \$connection_upgrade {" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i \ \ default upgrade;" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i \ \ default upgrade;" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i \ \ '' close;" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i \ \ '' close;" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i }" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i }" "$WS_CONF"
|
||||||
|
else
|
||||||
|
echo " > Upgrade connection mapping already setup."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "/$WS_MATCH1/i \\\n" "$WS_CONF"
|
sed -i "/$WS_MATCH1/i \\\n" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i upstream grafana {" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i upstream grafana {" "$WS_CONF"
|
||||||
sed -i "/$WS_MATCH2/i \ \ server localhost:3000;" "$WS_CONF"
|
sed -i "/$WS_MATCH2/i \ \ server localhost:3000;" "$WS_CONF"
|
||||||
|
|
Loading…
Reference in New Issue