@@ -136,6 +136,8 @@ const internalNginx = {
136
136
* @returns {Promise }
137
137
*/
138
138
renderLocations : ( host ) => {
139
+
140
+ // logger.info('host = ' + JSON.stringify(host, null, 2));
139
141
return new Promise ( ( resolve , reject ) => {
140
142
let template ;
141
143
@@ -153,21 +155,30 @@ const internalNginx = {
153
155
154
156
const locationRendering = async ( ) => {
155
157
for ( let i = 0 ; i < host . locations . length ; i ++ ) {
156
- let locationCopy = Object . assign ( { } , host . locations [ i ] ) ;
157
-
158
+ let locationCopy = Object . assign ( { } , { access_list_id : host . access_list_id } , { certificate_id : host . certificate_id } ,
159
+ { ssl_forced : host . ssl_forced } , { caching_enabled : host . caching_enabled } ,
160
+ { block_exploits : host . block_exploits } , { allow_websocket_upgrade : host . allow_websocket_upgrade } ,
161
+ { http2_support : host . http2_support } , { hsts_enabled : host . hsts_enabled } ,
162
+ { hsts_subdomains : host . hsts_subdomains } , { access_list : host . access_list } ,
163
+ { certificate : host . certificate } , host . locations [ i ] ) ;
164
+
158
165
if ( locationCopy . forward_host . indexOf ( '/' ) > - 1 ) {
159
166
const splitted = locationCopy . forward_host . split ( '/' ) ;
160
167
161
168
locationCopy . forward_host = splitted . shift ( ) ;
162
169
locationCopy . forward_path = `/${ splitted . join ( '/' ) } ` ;
163
170
}
164
171
172
+ // logger.info('locationCopy = ' + JSON.stringify(locationCopy, null, 2));
173
+
165
174
// eslint-disable-next-line
166
175
renderedLocations += await renderer . parseAndRender ( template , locationCopy ) ;
167
176
}
177
+
168
178
} ;
169
179
170
180
locationRendering ( ) . then ( ( ) => resolve ( renderedLocations ) ) ;
181
+
171
182
} ) ;
172
183
} ,
173
184
@@ -183,6 +194,8 @@ const internalNginx = {
183
194
logger . info ( 'Generating ' + host_type + ' Config:' , host ) ;
184
195
}
185
196
197
+ // logger.info('host = ' + JSON.stringify(host, null, 2));
198
+
186
199
let renderEngine = new Liquid ( {
187
200
root : __dirname + '/../templates/'
188
201
} ) ;
@@ -210,6 +223,7 @@ const internalNginx = {
210
223
}
211
224
212
225
if ( host . locations ) {
226
+ // logger.info ('host.locations = ' + JSON.stringify(host.locations, null, 2));
213
227
origLocations = [ ] . concat ( host . locations ) ;
214
228
locationsPromise = internalNginx . renderLocations ( host ) . then ( ( renderedLocations ) => {
215
229
host . locations = renderedLocations ;
0 commit comments