fixup
This commit is contained in:
parent
f40a8697bc
commit
5f2bc789c4
|
@ -1,7 +1,12 @@
|
|||
#!/bin/sh
|
||||
# Default to HTTP if PROTOCOL is not set
|
||||
PROTOCOL="${PROTOCOL:-http}"
|
||||
|
||||
# Replace placeholders with environment variable values
|
||||
envsubst '$BACKEND_ADDRESS $BACKEND_PORT $PROTOCOL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
||||
|
||||
# Use envsubst to replace environment variables in nginx.conf.template and output to nginx.conf
|
||||
envsubst '$BACKEND_ADDRESS,$BACKEND_PORT' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
||||
#envsubst '$BACKEND_ADDRESS,$BACKEND_PORT' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
||||
|
||||
# Start nginx in the foreground
|
||||
exec nginx -g 'daemon off;'
|
||||
|
|
|
@ -14,7 +14,8 @@ http {
|
|||
|
||||
location / {
|
||||
# Use the placeholders for the proxy pass (these will be replaced by envsubst)
|
||||
proxy_pass http://$BACKEND_ADDRESS:$BACKEND_PORT;
|
||||
proxy_pass ${PROTOCOL}://$BACKEND_ADDRESS:$BACKEND_PORT;
|
||||
# proxy_pass http://$BACKEND_ADDRESS:$BACKEND_PORT;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
|
Loading…
Reference in New Issue