blob: 784a5a0e491d2e002c54404ef52b29da510bb38a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/sh
set -e
if [ ! -z "$HOST" ]; then
ESCAPED_HOST=$(echo "$HOST" | sed 's/[\/&]/\\&/g')
find /usr/share/nginx/html -name "*.css" -type f -exec sed -i "s|/static/|${ESCAPED_HOST}/static/|g" {} \;
find /usr/share/nginx/html -name "*.js" -type f -exec sed -i "s|/static/|${ESCAPED_HOST}/static/|g" {} \;
echo "Updated static URLs to use HOST: $HOST"
else
echo "Serving static assets from /static/"
fi
exec nginx -g "daemon off;"
|