diff --git a/.buildpacks b/.buildpacks index 36201cad..eb20a5d0 100644 --- a/.buildpacks +++ b/.buildpacks @@ -1,3 +1,2 @@ https://github.com/heroku/heroku-buildpack-ruby.git https://github.com/drogus/last-commit-sha-buildpack.git -https://github.com/ryandotsmith/nginx-buildpack.git diff --git a/Procfile b/Procfile index 42675c0c..bbb53736 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1,2 @@ -web: bin/start-nginx bundle exec ./script/server +web: bundle exec ./script/server console: bundle exec ./script/console diff --git a/config/nginx.conf.erb b/config/nginx.conf.erb deleted file mode 100644 index b901bab8..00000000 --- a/config/nginx.conf.erb +++ /dev/null @@ -1,43 +0,0 @@ -daemon off; -#Heroku dynos have 4 cores. -worker_processes 4; - -events { - use epoll; - accept_mutex on; - worker_connections 1024; -} - -http { - gzip on; - gzip_comp_level 2; - gzip_min_length 512; - - log_format l2met 'measure.nginx.service=$request_time request_id=$http_heroku_request_id'; - access_log logs/nginx/access.log l2met; - error_log logs/nginx/error.log; - - include mime.types; - default_type application/octet-stream; - sendfile on; - - #Must read the body in 5 seconds. - client_body_timeout 5; - - upstream app_server { - server unix:/tmp/nginx.socket fail_timeout=0; - } - - server { - listen <%= ENV["PORT"] %>; - server_name _; - keepalive_timeout 5; - - location / { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_redirect off; - proxy_pass http://app_server; - } - } -} diff --git a/script/server b/script/server index 3c88cd81..01320b42 100755 --- a/script/server +++ b/script/server @@ -3,6 +3,6 @@ cd "$(dirname "$0")/.." [ $PORT ] || PORT=3000 [ $RACK_ENV ] || RACK_ENV=development -cmd="ruby -I lib -S bundle exec ruby -I lib -S unicorn config.ru -E $RACK_ENV -c config/unicorn.rb" +cmd="ruby -I lib -S bundle exec ruby -I lib -S unicorn config.ru -p $PORT -E $RACK_ENV -c config/unicorn.rb" [[ $RACK_ENV == "development" ]] && exec rerun "$cmd -l 127.0.0.1:$PORT" exec $cmd