Unverified Commit 42cc2f97 authored by Ben Cordero's avatar Ben Cordero Committed by GitHub
Browse files

Allow seeting the app host name to proxy to (#13)

parent f68990b0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
# `nginx-sidecar` changelog

## 0.3.6

- Allow specifying the app hostname to proxy to.

## 0.3.5

- Increase the size of the buffer that stores the response headers to 8K.
+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ services:
        environment:
        - name: NGINX_PORT
          value: '3000'
        - name: APP_HOST
          value: 'app'
        - name: APP_PORT
          value: '3001'

+1 −1
Original line number Diff line number Diff line
0.3.5
0.3.6
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ http {
      proxy_set_header Host $host;

      proxy_redirect off; # disable nginx redirect-rewrite logic
      proxy_pass http://app:<APP_PORT>;
      proxy_pass http://<APP_HOST>:<APP_PORT>;

      # The size of the buffer that stores the response headers
      proxy_buffer_size 8k;
+2 −1
Original line number Diff line number Diff line
@@ -6,13 +6,14 @@ set -ex
# so we substitute at run time
/bin/sed \
  -e "s/<NGINX_PORT>/${NGINX_PORT}/g" \
  -e "s/<APP_HOST>/${APP_HOST:-app}/g" \
  -e "s/<APP_PORT>/${APP_PORT}/g" \
  -e "s/<CLIENT_BODY_BUFFER_SIZE>/${CLIENT_BODY_BUFFER_SIZE:-8k}/g" \
  /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf

# Wait for the application to start before accepting ALB requests.
while sleep 2; do
  curl --verbose --fail --max-time 5 http://app:${APP_PORT}${HEALTHCHECK_PATH:-/health} && break
  curl --verbose --fail --max-time 5 "http://${APP_HOST:-app}:${APP_PORT}${HEALTHCHECK_PATH:-/health}" && break
done

# run in foreground as pid 1