Skip to content

A platform for community discussion. Free, open, simple.

DEV: add UNICORN_BIND_ALL

Jeff Wong64d51ab45ed1
diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb
index e38f345efa2..f4e6c4f9a3e 100644
--- a/config/unicorn.conf.rb
+++ b/config/unicorn.conf.rb
@@ -15,7 +15,7 @@ worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
working_directory discourse_path
# listen "#{discourse_path}/tmp/sockets/unicorn.sock"
-listen (ENV["UNICORN_PORT"] || 3000).to_i
+listen "#{(ENV["UNICORN_BIND_ALL"] ? "" : "127.0.0.1:")}#{(ENV["UNICORN_PORT"] || 3000).to_i}"
if !File.exist?("#{discourse_path}/tmp/pids")
FileUtils.mkdir_p("#{discourse_path}/tmp/pids")