05b787bc27
- Added BACKEND_URL environment variable to docker-compose for frontend service. - Introduced a new entrypoint script to configure nginx with the BACKEND_URL at runtime. - Created a template for nginx configuration to handle API and WebSocket requests dynamically. - Updated README with instructions for configuring reverse proxy setups. Fixes #12
16 lines
435 B
Bash
16 lines
435 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Set default backend URL if not provided
|
|
export BACKEND_URL="${BACKEND_URL:-backend:8000}"
|
|
|
|
echo "Configuring nginx with BACKEND_URL: ${BACKEND_URL}"
|
|
|
|
# Substitute environment variables in nginx config template
|
|
# Only substitute BACKEND_URL, preserve nginx variables like $http_upgrade
|
|
envsubst '${BACKEND_URL}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
|
|
|
# Execute the main command (nginx)
|
|
exec "$@"
|
|
|