mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
ADDED Nginx configuration for running behind load balancer
This commit is contained in:
committed by
Michael Hobbs
parent
63d8994243
commit
1b84527f8c
@@ -111,7 +111,11 @@ EOF
|
||||
if [[ -n "$NONSSL_VHOSTS" ]]; then
|
||||
NOSSL_SERVER_NAME=$(echo $NONSSL_VHOSTS | tr '\n' ' ')
|
||||
xargs -i echo "-----> Configuring {}..." <<< "$NONSSL_VHOSTS"
|
||||
[[ -z "$NGINX_CUSTOM_TEMPLATE" ]] && NGINX_TEMPLATE="$(dirname $0)/templates/nginx.conf.template"
|
||||
if [[ -n "$DOKKU_SSL_TERMINATED" ]] && [[ -z "$NGINX_CUSTOM_TEMPLATE" ]]; then
|
||||
NGINX_TEMPLATE="$(dirname $0)/templates/nginx.terminated.conf"
|
||||
elif [[ -z "$NGINX_CUSTOM_TEMPLATE" ]]; then
|
||||
NGINX_TEMPLATE="$(dirname $0)/templates/nginx.conf.template"
|
||||
fi
|
||||
eval "cat <<< \"$(< $NGINX_TEMPLATE)\" >> $NGINX_CONF"
|
||||
fi
|
||||
|
||||
|
||||
19
plugins/nginx-vhosts/templates/nginx.terminated.conf
Normal file
19
plugins/nginx-vhosts/templates/nginx.terminated.conf
Normal file
@@ -0,0 +1,19 @@
|
||||
# Nginx configuration when running behind a load balancer that terminates SSL
|
||||
# connections (e.g. AWS ELB)
|
||||
server {
|
||||
listen [::]:80;
|
||||
listen 80;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
location / {
|
||||
proxy_pass http://$APP;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade \$http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_set_header X-Forwarded-Proto \$http_x_forwarded_proto;
|
||||
proxy_set_header X-Forwarded-For \$http_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Port \$http_x_forwarded_port;
|
||||
proxy_set_header X-Request-Start \$msec;
|
||||
}
|
||||
include $DOKKU_ROOT/$APP/nginx.conf.d/*.conf;
|
||||
}
|
||||
Reference in New Issue
Block a user