11
11
error_log '<%= @options[:log_file] %>' <% if debugging? %>info<% end %>;
12
12
pid '<%= @options[:pid_file] %>';
13
14
<% if Process.euid == 0 %>
14
15
<% if @options[:user] %>
16
<%# Run workers as the given user. The master process will always run as root and will be able to bind to any port. %>
15
17
user <%= @options[:user] %> <%= default_group_for(@options[:user]) %>;
19
<%# Prevent running Nginx workers as nobody. %>
17
20
user <%= current_user %> <%= default_group_for(current_user) %>;
28
31
passenger_ruby <%= PlatformInfo.ruby_command %>;
29
32
passenger_root '<%= location_config_filename %>';
30
33
passenger_abort_on_startup_error on;
34
passenger_ctl cleanup_pidfiles <%= serialize_strset("#{@temp_dir}/temp_dir_toucher.pid") %>;
31
35
passenger_user_switching off;
32
36
passenger_max_pool_size <%= @options[:max_pool_size] %>;
33
37
passenger_min_instances <%= @options[:min_instances] %>;
34
38
<% if @options[:user] %>
35
39
passenger_user <%= @options[:user] %>;
36
40
passenger_default_user <%= @options[:user] %>;
41
passenger_analytics_log_user <%= @options[:user] %>;
38
43
passenger_user <%= current_user %>;
39
44
passenger_default_user <%= current_user %>;
45
passenger_analytics_log_user <%= current_user %>;
41
47
<% if debugging? %>passenger_log_level 2;<% end %>
48
<% if @options[:temp_dir] %>passenger_temp_dir '<%= @options[:temp_dir] %>';<% end %>
42
49
<% if @options[:rolling_restarts] %>passenger_rolling_restarts on;<% end %>
43
50
<% if @options[:resist_deployment_errors] %>passenger_resist_deployment_errors on;<% end %>
80
88
<% for app in @apps %>
82
listen <%= nginx_listen_address(app) %>;
90
listen <%= nginx_listen_address(app) %> <%= "ssl" if app[:ssl] %>;
83
91
server_name <%= app[:server_names].join(' ') %>;
84
root '<%= app[:root] %>/public';
92
<% if app[:static_files_dir] %>
93
root '<%= app[:static_files_dir] %>';
95
root '<%= app[:root] %>/public';
85
97
passenger_app_root '<%= app[:root] %>';
86
98
passenger_enabled on;
87
rails_env <%= app[:env] %>;
99
passenger_app_env <%= app[:environment] %>;
88
100
passenger_spawn_method <%= app[:spawn_method] %>;
101
<% if app[:app_type] %>passenger_app_type <%= app[:app_type] %>;<% end %>
102
<% if app[:startup_file] %>passenger_startup_file <%= app[:startup_file] %>;<% end %>
103
<% if app[:concurrency_model] != DEFAULT_CONCURRENCY_MODEL %>passenger_concurrency_model <%= app[:concurrency_model] %>;<% end %>
104
<% if app[:thread_count] != DEFAULT_THREAD_COUNT %>passenger_thread_count <%= app[:thread_count] %>;<% end %>
89
105
<% if app[:min_instances] %>passenger_min_instances <%= app[:min_instances] %>;<% end %>
106
<% if app[:restart_dir] %>passenger_restart_dir '<%= app[:restart_dir] %>';<% end %>
90
107
<% if app[:union_station_key] %>
91
108
union_station_support on;
92
109
union_station_key <%= app[:union_station_key] %>;
113
ssl_certificate <%= app[:ssl_certificate] %>;
114
ssl_certificate_key <%= app[:ssl_certificate_key] %>;
95
117
# Rails asset pipeline support.
96
118
location ~ ^/assets/ {