Skip to content

Commit 84e2a51

Browse files
committed
support for FORWARDED_ALLOW_IPS='*'
1 parent f1c2bc3 commit 84e2a51

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

bin/compile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ BUILD_DIR=$APP_DIR
103103

104104
# Set up outputs under new context
105105
PROFILE_PATH="$BUILD_DIR/.profile.d/python.sh"
106-
WEBCONCURRENCY_PROFILE_PATH="$BUILD_DIR/.profile.d/python.webconcurrency.sh"
106+
GUNICORN_PROFILE_PATH="$BUILD_DIR/.profile.d/python.gunicorn.sh"
107107

108108
# We'll need to send these statics to other scripts we `source`.
109109
export BUILD_DIR CACHE_DIR BIN_DIR PROFILE_PATH
@@ -221,8 +221,8 @@ set-default-env LANG en_US.UTF-8
221221
set-default-env PYTHONHASHSEED random
222222
set-default-env PYTHONPATH /app/
223223

224-
# Install sane-default script for WEB_CONCURRENCY environment variable.
225-
cp $ROOT_DIR/vendor/python.webconcurrency.sh $WEBCONCURRENCY_PROFILE_PATH
224+
# Install sane-default script for $WEB_CONCURRENCY and $FORWARDED_ALLOW_IPS.
225+
cp $ROOT_DIR/vendor/python.gunicorn.sh $GUNICORN_PROFILE_PATH
226226

227227

228228
# Experimental post_compile hook.
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
case $(ulimit -u) in
22

3-
# 1X DYNO
3+
# Automatic configuration for Gunicorn's Workers setting.
4+
5+
# Standard-1X (+Free, +Hobby) Dyno
46
256)
57
export DYNO_RAM=512
68
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-2}
79
;;
810

9-
# 2X DYNO
11+
# Standard-2X Dyno
1012
512)
1113
export DYNO_RAM=1024
1214
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-4}
1315
;;
1416

15-
# IX DYNO
17+
# Performance-M Dyno
1618
16384)
1719
export DYNO_RAM=2560
1820
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-8}
1921
;;
2022

21-
# PX DYNO
23+
# Performance-L Dyno
2224
32768)
2325
export DYNO_RAM=6656
2426
export WEB_CONCURRENCY=${WEB_CONCURRENCY:-11}
2527
;;
2628

2729
esac
30+
31+
# Automatic configuration for Gunicorn's ForwardedAllowIPS setting.
32+
export FORWARDED_ALLOW_IPS='*'

0 commit comments

Comments
 (0)