5 changed files with 41 additions and 45 deletions
@ -1,10 +1,15 @@ |
|||
#!/bin/bash |
|||
|
|||
source /opt/app-root/etc/generate_container_user |
|||
test -f /opt/app-root/etc/generate_container_user && source /opt/app-root/etc/generate_container_user |
|||
|
|||
set -e |
|||
|
|||
# Default values are set here |
|||
export "LOG_LEVEL=${LOG_LEVEL:=info}" |
|||
export "NGINX_CONF=${NGINX_CONF:=/opt/app-root/etc/}" |
|||
|
|||
exec nginx -g "daemon off;" -c "/opt/app-root/etc/nginx.conf" |
|||
if [ -f "$NGINX_CONF/nginx.env.conf" ]; then |
|||
envsubst '$LOG_LEVEL:$RESOLVER:$APP_ROOT:$SSO_SERVICE_HOSTNAME:$PROXY_ROUTE_HOSTNAME' < "$NGINX_CONF/nginx.env.conf" > "$NGINX_CONF/nginx.conf" |
|||
fi |
|||
|
|||
exec nginx -g "daemon off;" -c "$NGINX_CONF/nginx.conf" |
|||
|
|||
@ -1,17 +0,0 @@ |
|||
worker_processes 1; |
|||
env $LOG_LEVEL; |
|||
error_log stderr ${LOG_LEVEL}; |
|||
|
|||
events { |
|||
worker_connections 1024; |
|||
} |
|||
|
|||
http { |
|||
include mime.types; |
|||
default_type text/plain; |
|||
sendfile on; |
|||
keepalive_timeout 65; |
|||
} |
|||
|
|||
include nginx.d/*.conf; |
|||
|
|||
@ -1,24 +0,0 @@ |
|||
env PROXY_ROUTE_HOSTNAME; |
|||
env APP_ROOT; |
|||
env RESOLVER; |
|||
env SSO_SERVICE_HOSTNAME; |
|||
|
|||
resolver ${RESOLVER} ipv6=off; |
|||
|
|||
server { |
|||
listen 8443 ssl; |
|||
server_name ${PROXY_ROUTE_HOSTNAME}; |
|||
|
|||
ssl on; |
|||
ssl_certificate ${APP_ROOT}/etc/serving-cert/tls.crt; |
|||
ssl_certificate_key ${APP_ROOT}/etc/serving-cert/tls.key; |
|||
|
|||
location / { |
|||
proxy_pass http://${SSO_SERVICE_HOSTNAME}; |
|||
proxy_set_header Host $host; |
|||
proxy_set_header X-Real-IP $remote_addr; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header X-Forwarded-Proto $scheme; |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,33 @@ |
|||
error_log stderr ${LOG_LEVEL}; |
|||
|
|||
worker_processes 1; |
|||
|
|||
events { |
|||
worker_connections 1024; |
|||
} |
|||
|
|||
http { |
|||
default_type text/plain; |
|||
sendfile on; |
|||
keepalive_timeout 65; |
|||
resolver ${RESOLVER} ipv6=off; |
|||
|
|||
server { |
|||
listen 8443 ssl; |
|||
server_name ${PROXY_ROUTE_HOSTNAME}; |
|||
|
|||
ssl on; |
|||
ssl_certificate ${APP_ROOT}/etc/serving-cert/tls.crt; |
|||
ssl_certificate_key ${APP_ROOT}/etc/serving-cert/tls.key; |
|||
|
|||
location / { |
|||
proxy_pass http://${SSO_SERVICE_HOSTNAME}; |
|||
proxy_set_header Host $host; |
|||
proxy_set_header X-Real-IP $remote_addr; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header X-Forwarded-Proto $scheme; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
Loading…
Reference in new issue