@@ -284,12 +284,12 @@ location /coffee {
284284 js_content httpmatches.match; // chooses backend1 or backend2, and redirects to appropriate internal location
285285}
286286location /_ngf-internal-rule0-route0 {
287- internal;
288- proxy_pass http://backend1;
287+ internal;
288+ proxy_pass http://backend1;
289289}
290290location /_ngf-internal-rule1-route0 {
291- internal;
292- proxy_pass http://backend2;
291+ internal;
292+ proxy_pass http://backend2;
293293}
294294---------------
295295Inference extension, no HTTP matching conditions.
@@ -302,42 +302,41 @@ location /coffee {
302302 js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
303303}
304304location /_ngf-internal-proxy-pass-rule0-route0-backend0-inference {
305- internal;
306- proxy_pass http://$inference-backend ;
305+ internal;
306+ proxy_pass http://$inference_backend_test_foo_80 ;
307307}
308308---------------
309309Inference extension with multiple inference backends.
310310
311311location /coffee {
312- rewrite $inference_backend_group_routeNS__routeName_rule0 last;
313- proxy_http_version 1.1;
312+ rewrite ^ $inference_backend_group_routeNS__routeName_rule0_pathRule0 last;
314313}
315314
316315location /_ngf-internal-proxy-pass-rule0-route0-backend0-inference {
317- internal;
318- proxy_pass http://$inference-backend0 ;
316+ internal;
317+ proxy_pass http://$inference_backend_test_primary_pool_80 ;
319318}
320319
321- location /_ngf-internal-upstreamNamePrimary -routeNS-routeName-rule0 {
322- internal;
323- set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
324- js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
320+ location /_ngf-internal-test_primary_pool_80 -routeNS-routeName-routeRule0-pathRule0 {
321+ internal;
322+ set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
323+ js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
325324}
326325
327326location /_ngf-internal-proxy-pass-rule0-route0-backend1-inference {
328- internal;
329- proxy_pass http://$inference-backend1 ;
327+ internal;
328+ proxy_pass http://$inference_backend_test_secondary_pool_80 ;
330329}
331330
332- location /_ngf-internal-upstreamNameSecondary -routeNS-routeName-rule0 {
333- internal;
334- set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend1-inference;
335- js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend1-inference
331+ location /_ngf-internal-test_secondary_pool_80 -routeNS-routeName-routeRule0-pathRule0 {
332+ internal;
333+ set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend1-inference;
334+ js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend1-inference
336335}
337336
338- split_clients $request_id $inference_backend_group_routeNS__routeName_rule0 {
339- 70.00% /_ngf-internal-upstreamNamePrimary -routeNS-routeName-rule0 ;
340- 30.00% /_ngf-internal-upstreamNameSecondary -routeNS-routeName-rule0 ;
337+ split_clients $request_id $inference_backend_group_routeNS__routeName_rule0_pathRule0 {
338+ 70.00% /_ngf-internal-test_primary_pool_80 -routeNS-routeName-routeRule0-pathRule0 ;
339+ 30.00% /_ngf-internal-test_secondary_pool_80 -routeNS-routeName-routeRule0-pathRule0 ;
341340}
342341---------------
343342Inference extension with HTTP matching conditions.
@@ -347,23 +346,17 @@ and which backend to use, then redirects to the internal inference location. The
347346location calls the inference NJS module to get the AI endpoint to proxy to, then redirects to the
348347internal location that proxies to the backend.
349348
350- Note that the location path naming here is a little different than the previous example.
351- The final location that proxy_passes has the non-inference name to avoid too much refactoring
352- in the code, and the intermediate location has -inference in the name, whereas in the previous example
353- it was the final location that had -inference in the name.
354-
355349location /coffee {
356- js_content httpmatches.match; // chooses backend and redirects to appropriate internal inference location
350+ js_content httpmatches.match; // chooses backend and redirects to appropriate internal inference location
357351}
358- location /_ngf-internal-upstreamNamePrimary-routeNS-routeName-rule0 {
359- internal;
360-
361- set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
362- js_content epp.getEndpoint; // redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
352+ location /_ngf-internal-test_foo_80-routeNS-routeName-routeRule0-pathRule0 {
353+ internal;
354+ set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
355+ js_content epp.getEndpoint; // redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
363356}
364357location /_ngf-internal-proxy-pass-rule0-route0-backend0-inference {
365- internal;
366- proxy_pass http://$inference-backend ;
358+ internal;
359+ proxy_pass http://$inference_backend_test_foo_80 ;
367360}
368361---------------
369362Inference extension with multiple backends with HTTP matching conditions.
@@ -374,41 +367,39 @@ location based on a split clients variable. That internal inference location cal
374367to get the AI endpoint to proxy to, then redirects to the internal location that proxies to the backend.
375368
376369location /coffee {
377- js_content httpmatches.match; // chooses backend and redirects to appropriate internal inference location
370+ js_content httpmatches.match; // chooses backend and redirects to appropriate internal inference location
378371}
379372
380373location /_ngf-internal-split-clients-rule0-route0-inference {
381- internal;
382-
383- rewrite $inference_backend_group_routeNS__routeName_rule0 last;
384- proxy_http_version 1.1;
374+ internal;
375+ rewrite ^ $inference_backend_group_routeNS__routeName_rule0_pathRule0 last;
385376}
386377
387378location /_ngf-internal-proxy-pass-rule0-route0-backend0-inference {
388- internal;
389- proxy_pass http://$inference-backend0 ;
379+ internal;
380+ proxy_pass http://$inference_backend_test_primary_pool_80 ;
390381}
391382
392- location /_ngf-internal-upstreamNamePrimary -routeNS-routeName-rule0 {
393- internal;
394- set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
395- js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
383+ location /_ngf-internal-test_primary_pool_80 -routeNS-routeName-routeRule0-pathRule0 {
384+ internal;
385+ set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend0-inference;
386+ js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend0-inference
396387}
397388
398389location /_ngf-internal-proxy-pass-rule0-route0-backend1-inference {
399- internal;
400- proxy_pass http://$inference-backend1 ;
390+ internal;
391+ proxy_pass http://$inference_backend_test_secondary_pool_80 ;
401392}
402393
403- location /_ngf-internal-upstreamNameSecondary -routeNS-routeName-rule0 {
404- internal;
405- set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend1-inference;
406- js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend1-inference
394+ location /_ngf-internal-test_secondary_pool_80 -routeNS-routeName-routeRule0-pathRule0 {
395+ internal;
396+ set $epp_internal_path /_ngf-internal-proxy-pass-rule0-route0-backend1-inference;
397+ js_content epp.getEndpoint; // gets endpoint and redirects to /_ngf-internal-proxy-pass-rule0-route0-backend1-inference
407398}
408399
409- split_clients $request_id $inference_backend_group_routeNS__routeName_rule0 {
410- 70.00% /_ngf-internal-upstreamNamePrimary -routeNS-routeName-rule0 ;
411- 30.00% /_ngf-internal-upstreamNameSecondary -routeNS-routeName-rule0 ;
400+ split_clients $request_id $inference_backend_group_routeNS__routeName_rule0_pathRule0 {
401+ 70.00% /_ngf-internal-test_primary_pool_80 -routeNS-routeName-routeRule0-pathRule0 ;
402+ 30.00% /_ngf-internal-test_secondary_pool_80 -routeNS-routeName-routeRule0-pathRule0 ;
412403}
413404*/
414405
0 commit comments