aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/docker/production/entrypoint.nginx.sh
blob: 670ce84a3fd98e9e4d4e64840e4f942a8261b23d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
set -e

# Process the nginx template
SOURCE_FILE="/etc/nginx/conf.d/peertube.template"
TARGET_FILE="/etc/nginx/conf.d/default.conf"
export WEBSERVER_HOST="default_server"
export PEERTUBE_HOST="peertube:9000"

envsubst '${WEBSERVER_HOST} ${PEERTUBE_HOST}' < $SOURCE_FILE > $TARGET_FILE

# Remove HTTPS/SSL from nginx conf since this image is meant as a webserver _behind_ a reverse-proxy doing TLS termination itself
sed -i 's/443 ssl http2/80/g;/ssl_/d' $TARGET_FILE

nginx -g "daemon off;"