Skip to content

Commit

Permalink
Write listen directive to a file on start so we can get the port number
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyfrey committed Aug 21, 2015
1 parent 005ca03 commit 9c1528a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/start-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ mkfifo $psmgr
#Evaluate config to get $PORT
erb config/nginx.conf.erb > config/nginx.conf

#Evaluate to write port file
erb config/port_config.erb > config/port_config

n=1
while getopts :f option ${@:1:2}
do
Expand Down
1 change: 1 addition & 0 deletions config/port_config.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
listen <%= ENV["PORT"] %>;

0 comments on commit 9c1528a

Please sign in to comment.