passenger 4.0.14 → 4.0.16

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (121) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +69 -0
  3. data/bin/passenger-install-apache2-module +7 -1
  4. data/bin/passenger-install-nginx-module +18 -1
  5. data/build/apache2.rb +25 -1
  6. data/build/basics.rb +7 -4
  7. data/build/debian.rb +72 -25
  8. data/build/nginx.rb +24 -0
  9. data/build/packaging.rb +45 -3
  10. data/debian.template/{control → control.template} +17 -8
  11. data/debian.template/ruby-passenger.install.template +1 -0
  12. data/debian.template/rules.template +9 -3
  13. data/dev/run_travis.sh +14 -0
  14. data/doc/Users guide Apache.idmap.txt +64 -48
  15. data/doc/Users guide Apache.txt +127 -93
  16. data/doc/Users guide Nginx.idmap.txt +46 -28
  17. data/doc/Users guide Nginx.txt +100 -12
  18. data/doc/images/{conservative_spawning.png → direct_spawning.png} +0 -0
  19. data/doc/images/{conservative_spawning.svg → direct_spawning.svg} +0 -0
  20. data/doc/users_guide_snippets/installation.txt +107 -66
  21. data/doc/users_guide_snippets/passenger_spawn_method.txt +1 -1
  22. data/doc/users_guide_snippets/rvm_helper_tool.txt +0 -12
  23. data/doc/users_guide_snippets/tips.txt +70 -3
  24. data/doc/users_guide_snippets/under_the_hood/page_caching_support.txt +2 -0
  25. data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +114 -0
  26. data/ext/apache2/Configuration.cpp +53 -101
  27. data/ext/apache2/Configuration.hpp +19 -41
  28. data/ext/apache2/ConfigurationCommands.cpp +95 -0
  29. data/ext/apache2/ConfigurationCommands.cpp.erb +91 -0
  30. data/ext/apache2/ConfigurationFields.hpp +59 -0
  31. data/ext/apache2/ConfigurationFields.hpp.erb +89 -0
  32. data/ext/apache2/ConfigurationSetters.cpp +223 -0
  33. data/ext/apache2/ConfigurationSetters.cpp.erb +126 -0
  34. data/ext/apache2/CreateDirConfig.cpp +50 -0
  35. data/ext/apache2/CreateDirConfig.cpp.erb +71 -0
  36. data/ext/apache2/Hooks.cpp +6 -0
  37. data/ext/apache2/MergeDirConfig.cpp +103 -0
  38. data/ext/apache2/MergeDirConfig.cpp.erb +81 -0
  39. data/ext/common/ApplicationPool2/AppTypes.cpp +2 -0
  40. data/ext/common/ApplicationPool2/AppTypes.h +2 -0
  41. data/ext/common/ApplicationPool2/Common.h +1 -1
  42. data/ext/common/ApplicationPool2/Group.h +56 -7
  43. data/ext/common/ApplicationPool2/Implementation.cpp +133 -31
  44. data/ext/common/ApplicationPool2/Options.h +23 -2
  45. data/ext/common/ApplicationPool2/Pool.h +8 -1
  46. data/ext/common/ApplicationPool2/Process.h +9 -0
  47. data/ext/common/ApplicationPool2/Session.h +1 -0
  48. data/ext/common/ApplicationPool2/Spawner.h +21 -19
  49. data/ext/common/ApplicationPool2/SuperGroup.h +1 -1
  50. data/ext/common/Constants.h +21 -17
  51. data/ext/common/Constants.h.erb +1 -1
  52. data/ext/common/Exceptions.h +19 -0
  53. data/ext/common/ServerInstanceDir.h +8 -4
  54. data/ext/common/Utils.cpp +33 -1
  55. data/ext/common/Utils.h +14 -0
  56. data/ext/common/Utils/StrIntUtils.cpp +16 -0
  57. data/ext/common/Utils/StrIntUtils.h +5 -0
  58. data/ext/common/agents/HelperAgent/Main.cpp +5 -5
  59. data/ext/common/agents/HelperAgent/RequestHandler.h +94 -45
  60. data/ext/common/agents/LoggingAgent/Main.cpp +10 -26
  61. data/ext/common/agents/Watchdog/Main.cpp +4 -15
  62. data/ext/nginx/CacheLocationConfig.c +501 -0
  63. data/ext/nginx/CacheLocationConfig.c.erb +140 -0
  64. data/ext/nginx/Configuration.c +29 -453
  65. data/ext/nginx/Configuration.h +3 -21
  66. data/ext/nginx/ConfigurationCommands.c +501 -0
  67. data/ext/nginx/ConfigurationCommands.c.erb +136 -0
  68. data/ext/nginx/ConfigurationFields.h +89 -0
  69. data/ext/nginx/ConfigurationFields.h.erb +85 -0
  70. data/ext/nginx/ContentHandler.c +3 -166
  71. data/ext/nginx/CreateLocationConfig.c +146 -0
  72. data/ext/nginx/CreateLocationConfig.c.erb +70 -0
  73. data/ext/nginx/MergeLocationConfig.c +166 -0
  74. data/ext/nginx/MergeLocationConfig.c.erb +72 -0
  75. data/ext/nginx/config +4 -0
  76. data/ext/oxt/detail/tracable_exception_disabled.hpp +21 -1
  77. data/ext/oxt/detail/tracable_exception_enabled.hpp +4 -1
  78. data/ext/oxt/implementation.cpp +7 -1
  79. data/ext/oxt/macros.hpp +9 -7
  80. data/helper-scripts/backtrace-sanitizer.rb +23 -0
  81. data/helper-scripts/classic-rails-loader.rb +23 -0
  82. data/helper-scripts/classic-rails-preloader.rb +23 -0
  83. data/helper-scripts/download_binaries/extconf.rb +10 -5
  84. data/helper-scripts/meteor-loader.rb +127 -0
  85. data/helper-scripts/node-loader.js +1 -1
  86. data/helper-scripts/rack-preloader.rb +23 -0
  87. data/helper-scripts/system-memory-stats.py +22 -0
  88. data/helper-scripts/touch-dir.sh +48 -0
  89. data/lib/phusion_passenger.rb +1 -1
  90. data/lib/phusion_passenger/apache2/config_options.rb +104 -0
  91. data/lib/phusion_passenger/constants.rb +8 -0
  92. data/lib/phusion_passenger/native_support.rb +9 -1
  93. data/lib/phusion_passenger/nginx/config_options.rb +328 -0
  94. data/lib/phusion_passenger/packaging.rb +2 -2
  95. data/lib/phusion_passenger/platform_info/apache.rb +8 -0
  96. data/lib/phusion_passenger/platform_info/compiler.rb +2 -2
  97. data/lib/phusion_passenger/rails3_extensions/init.rb +19 -4
  98. data/lib/phusion_passenger/ruby_core_enhancements.rb +4 -1
  99. data/lib/phusion_passenger/standalone/app_finder.rb +3 -2
  100. data/lib/phusion_passenger/standalone/command.rb +1 -0
  101. data/lib/phusion_passenger/standalone/runtime_installer.rb +1 -6
  102. data/lib/phusion_passenger/standalone/runtime_locator.rb +9 -2
  103. data/lib/phusion_passenger/standalone/start_command.rb +45 -9
  104. data/lib/phusion_passenger/utils.rb +4 -1
  105. data/resources/templates/{nginx → installer_common}/run_installer_as_root.txt.erb +3 -1
  106. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +6 -0
  107. data/resources/templates/standalone/config.erb +8 -8
  108. data/test/cxx/ApplicationPool2/PoolTest.cpp +120 -3
  109. data/test/cxx/RequestHandlerTest.cpp +66 -3
  110. data/test/integration_tests/native_packaging_spec.rb +41 -0
  111. data/test/integration_tests/nginx_tests.rb +1 -0
  112. data/test/integration_tests/standalone_tests.rb +4 -0
  113. data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +22 -0
  114. data/test/stub/rails3.0/config/initializers/passenger.rb +2 -1
  115. data/test/stub/rails3.1/config/initializers/passenger.rb +2 -1
  116. data/test/stub/rails3.2/config/initializers/passenger.rb +2 -1
  117. data/test/stub/rails4.0/config/initializers/passenger.rb +5 -1
  118. data/test/stub/wsgi/passenger_wsgi.py +5 -0
  119. metadata +32 -7
  120. metadata.gz.asc +7 -7
  121. data/resources/templates/apache2/run_installer_as_root.txt.erb +0 -8
@@ -0,0 +1,146 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /*
27
+ * CreateLocationConfig.c is automatically generated from CreateLocationConfig.c.erb,
28
+ * using definitions from lib/phusion_passenger/nginx/config_options.rb.
29
+ * Edits to CreateLocationConfig.c will be lost.
30
+ *
31
+ * To update CreateLocationConfig.c:
32
+ * rake nginx
33
+ *
34
+ * To force regeneration of CreateLocationConfig.c:
35
+ * rm -f ext/nginx/CreateLocationConfig.c
36
+ * rake ext/nginx/CreateLocationConfig.c
37
+ */
38
+
39
+
40
+
41
+
42
+
43
+ conf->enabled = NGX_CONF_UNSET;
44
+
45
+
46
+
47
+ conf->ruby.data = NULL;
48
+ conf->ruby.len = 0;
49
+
50
+
51
+
52
+ conf->python.data = NULL;
53
+ conf->python.len = 0;
54
+
55
+
56
+
57
+ conf->environment.data = NULL;
58
+ conf->environment.len = 0;
59
+
60
+
61
+
62
+ conf->friendly_error_pages = NGX_CONF_UNSET;
63
+
64
+
65
+
66
+ conf->min_instances = NGX_CONF_UNSET;
67
+
68
+
69
+
70
+ conf->max_requests = NGX_CONF_UNSET;
71
+
72
+
73
+
74
+ conf->start_timeout = NGX_CONF_UNSET;
75
+
76
+
77
+
78
+ conf->base_uris = NGX_CONF_UNSET_PTR;
79
+
80
+
81
+
82
+ conf->user.data = NULL;
83
+ conf->user.len = 0;
84
+
85
+
86
+
87
+ conf->group.data = NULL;
88
+ conf->group.len = 0;
89
+
90
+
91
+
92
+ conf->app_group_name.data = NULL;
93
+ conf->app_group_name.len = 0;
94
+
95
+
96
+
97
+ conf->app_root.data = NULL;
98
+ conf->app_root.len = 0;
99
+
100
+
101
+
102
+ conf->app_rights.data = NULL;
103
+ conf->app_rights.len = 0;
104
+
105
+
106
+
107
+ conf->union_station_support = NGX_CONF_UNSET;
108
+
109
+
110
+
111
+ conf->union_station_filters = NGX_CONF_UNSET_PTR;
112
+
113
+
114
+
115
+ conf->debugger = NGX_CONF_UNSET;
116
+
117
+
118
+
119
+ conf->show_version_in_header = NGX_CONF_UNSET;
120
+
121
+
122
+
123
+ conf->max_preloader_idle_time = NGX_CONF_UNSET;
124
+
125
+
126
+
127
+ conf->vars_source = NGX_CONF_UNSET_PTR;
128
+
129
+
130
+
131
+ conf->spawn_method.data = NULL;
132
+ conf->spawn_method.len = 0;
133
+
134
+
135
+
136
+ conf->union_station_key.data = NULL;
137
+ conf->union_station_key.len = 0;
138
+
139
+
140
+
141
+ conf->max_request_queue_size = NGX_CONF_UNSET;
142
+
143
+
144
+
145
+ conf->request_queue_overflow_status_code = NGX_CONF_UNSET;
146
+
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /*
27
+ * CreateLocationConfig.c is automatically generated from CreateLocationConfig.c.erb,
28
+ * using definitions from lib/phusion_passenger/nginx/config_options.rb.
29
+ * Edits to CreateLocationConfig.c will be lost.
30
+ *
31
+ * To update CreateLocationConfig.c:
32
+ * rake nginx
33
+ *
34
+ * To force regeneration of CreateLocationConfig.c:
35
+ * rm -f ext/nginx/CreateLocationConfig.c
36
+ * rake ext/nginx/CreateLocationConfig.c
37
+ */
38
+
39
+ <%
40
+ require 'phusion_passenger/nginx/config_options'
41
+
42
+ def filter_eligible_options(options)
43
+ return options.reject do |option|
44
+ option[:alias_for] ||
45
+ option.fetch(:field, true).nil? ||
46
+ option[:field].to_s =~ /\./
47
+ end
48
+ end
49
+
50
+ def struct_field_for(option)
51
+ if option.has_key?(:field)
52
+ return option[:field]
53
+ else
54
+ return option[:name].sub(/^passenger_/, '')
55
+ end
56
+ end
57
+ %>
58
+
59
+ <% for option in filter_eligible_options(LOCATION_CONFIGURATION_OPTIONS) %>
60
+ <% if option[:type] == :string %>
61
+ conf-><%= struct_field_for(option) %>.data = NULL;
62
+ conf-><%= struct_field_for(option) %>.len = 0;
63
+ <% elsif option[:type] == :integer || option[:type] == :flag %>
64
+ conf-><%= struct_field_for(option) %> = NGX_CONF_UNSET;
65
+ <% elsif option[:type] == :string_array || option[:type] == :string_keyval %>
66
+ conf-><%= struct_field_for(option) %> = NGX_CONF_UNSET_PTR;
67
+ <% else %>
68
+ <% raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}" %>
69
+ <% end %>
70
+ <% end %>
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /*
27
+ * MergeLocationConfig.c is automatically generated from MergeLocationConfig.c.erb,
28
+ * using definitions from lib/phusion_passenger/nginx/config_options.rb.
29
+ * Edits to MergeLocationConfig.c will be lost.
30
+ *
31
+ * To update MergeLocationConfig.c:
32
+ * rake nginx
33
+ *
34
+ * To force regeneration of MergeLocationConfig.c:
35
+ * rm -f ext/nginx/MergeLocationConfig.c
36
+ * rake ext/nginx/MergeLocationConfig.c
37
+ */
38
+
39
+
40
+
41
+
42
+
43
+ ngx_conf_merge_value(conf->enabled,
44
+ prev->enabled,
45
+ NGX_CONF_UNSET);
46
+
47
+
48
+
49
+ ngx_conf_merge_str_value(conf->ruby,
50
+ prev->ruby,
51
+ NULL);
52
+
53
+
54
+
55
+ ngx_conf_merge_str_value(conf->python,
56
+ prev->python,
57
+ NULL);
58
+
59
+
60
+
61
+ ngx_conf_merge_str_value(conf->environment,
62
+ prev->environment,
63
+ NULL);
64
+
65
+
66
+
67
+ ngx_conf_merge_value(conf->friendly_error_pages,
68
+ prev->friendly_error_pages,
69
+ NGX_CONF_UNSET);
70
+
71
+
72
+
73
+ ngx_conf_merge_value(conf->min_instances,
74
+ prev->min_instances,
75
+ NGX_CONF_UNSET);
76
+
77
+
78
+
79
+ ngx_conf_merge_value(conf->max_requests,
80
+ prev->max_requests,
81
+ NGX_CONF_UNSET);
82
+
83
+
84
+
85
+ ngx_conf_merge_value(conf->start_timeout,
86
+ prev->start_timeout,
87
+ NGX_CONF_UNSET);
88
+
89
+
90
+
91
+ ngx_conf_merge_str_value(conf->user,
92
+ prev->user,
93
+ NULL);
94
+
95
+
96
+
97
+ ngx_conf_merge_str_value(conf->group,
98
+ prev->group,
99
+ NULL);
100
+
101
+
102
+
103
+ ngx_conf_merge_str_value(conf->app_group_name,
104
+ prev->app_group_name,
105
+ NULL);
106
+
107
+
108
+
109
+ ngx_conf_merge_str_value(conf->app_root,
110
+ prev->app_root,
111
+ NULL);
112
+
113
+
114
+
115
+ ngx_conf_merge_str_value(conf->app_rights,
116
+ prev->app_rights,
117
+ NULL);
118
+
119
+
120
+
121
+ ngx_conf_merge_value(conf->union_station_support,
122
+ prev->union_station_support,
123
+ NGX_CONF_UNSET);
124
+
125
+
126
+
127
+ ngx_conf_merge_value(conf->debugger,
128
+ prev->debugger,
129
+ NGX_CONF_UNSET);
130
+
131
+
132
+
133
+ ngx_conf_merge_value(conf->show_version_in_header,
134
+ prev->show_version_in_header,
135
+ NGX_CONF_UNSET);
136
+
137
+
138
+
139
+ ngx_conf_merge_value(conf->max_preloader_idle_time,
140
+ prev->max_preloader_idle_time,
141
+ NGX_CONF_UNSET);
142
+
143
+
144
+
145
+ ngx_conf_merge_str_value(conf->spawn_method,
146
+ prev->spawn_method,
147
+ NULL);
148
+
149
+
150
+
151
+ ngx_conf_merge_str_value(conf->union_station_key,
152
+ prev->union_station_key,
153
+ NULL);
154
+
155
+
156
+
157
+ ngx_conf_merge_value(conf->max_request_queue_size,
158
+ prev->max_request_queue_size,
159
+ NGX_CONF_UNSET);
160
+
161
+
162
+
163
+ ngx_conf_merge_value(conf->request_queue_overflow_status_code,
164
+ prev->request_queue_overflow_status_code,
165
+ NGX_CONF_UNSET);
166
+
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2013 Phusion
4
+ *
5
+ * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ */
25
+
26
+ /*
27
+ * MergeLocationConfig.c is automatically generated from MergeLocationConfig.c.erb,
28
+ * using definitions from lib/phusion_passenger/nginx/config_options.rb.
29
+ * Edits to MergeLocationConfig.c will be lost.
30
+ *
31
+ * To update MergeLocationConfig.c:
32
+ * rake nginx
33
+ *
34
+ * To force regeneration of MergeLocationConfig.c:
35
+ * rm -f ext/nginx/MergeLocationConfig.c
36
+ * rake ext/nginx/MergeLocationConfig.c
37
+ */
38
+
39
+ <%
40
+ require 'phusion_passenger/nginx/config_options'
41
+
42
+ def filter_eligible_options(options)
43
+ return options.reject do |option|
44
+ option[:alias_for] ||
45
+ option.fetch(:field, true).nil? ||
46
+ option[:field].to_s =~ /\./ ||
47
+ !option.fetch(:auto_generate_nginx_merge_code, true)
48
+ end
49
+ end
50
+
51
+ def struct_field_for(option)
52
+ if option.has_key?(:field)
53
+ return option[:field]
54
+ else
55
+ return option[:name].sub(/^passenger_/, '')
56
+ end
57
+ end
58
+ %>
59
+
60
+ <% for option in filter_eligible_options(LOCATION_CONFIGURATION_OPTIONS) %>
61
+ <% if option[:type] == :string %>
62
+ ngx_conf_merge_str_value(conf-><%= struct_field_for(option) %>,
63
+ prev-><%= struct_field_for(option) %>,
64
+ NULL);
65
+ <% elsif option[:type] == :integer || option[:type] == :flag %>
66
+ ngx_conf_merge_value(conf-><%= struct_field_for(option) %>,
67
+ prev-><%= struct_field_for(option) %>,
68
+ NGX_CONF_UNSET);
69
+ <% else %>
70
+ <% raise "Unknown option type #{option[:type].inspect} for option #{option[:name]}" %>
71
+ <% end %>
72
+ <% end %>