Skip to content

Commit

Permalink
Fix Unix domain socket support in Passenger Standalone.
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 11, 2010
1 parent 62ed3c9 commit 2f225dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/phusion_passenger/standalone/start_command.rb
Expand Up @@ -484,16 +484,16 @@ def stop_threads

#### Config file template helpers ####

def nginx_listen_address(for_ping_port = false)
if @options[:socket_file]
return "unix:" + File.expand_path(@options[:socket_file])
def nginx_listen_address(options = @options, for_ping_port = false)
if options[:socket_file]
return "unix:" + File.expand_path(options[:socket_file])
else
if for_ping_port
port = @options[:ping_port]
port = options[:ping_port]
else
port = @options[:port]
port = options[:port]
end
return "#{@options[:address]}:#{port}"
return "#{options[:address]}:#{port}"
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/phusion_passenger/templates/standalone/config.erb
Expand Up @@ -41,14 +41,14 @@ http {
<% if @options[:ping_port] %>
server {
listen <%= nginx_listen_address(true) %>;
listen <%= nginx_listen_address(@options, true) %>;
root '<%= LIBDIR %>/phusion_passenger/templates/standalone_default_root';
}
<% end %>
<% for app in @apps %>
server {
listen <%= @options[:address] %>:<%= @options[:port] %>;
listen <%= nginx_listen_address(app) %>;
server_name <%= app[:server_names].join(' ') %>;
root '<%= app[:root] %>/public';
passenger_enabled on;
Expand Down

0 comments on commit 2f225dd

Please sign in to comment.