Skip to content

Commit

Permalink
Strip versions from ibis paths (#2167)
Browse files Browse the repository at this point in the history
* Strip versions for nginz paths outside wire-server

* Add CHANGELOG entry
  • Loading branch information
pcapriotti authored Mar 9, 2022
1 parent c968c4a commit 998cec1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.d/1-api-changes/strip-ibis-paths
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The `/billing` and `/teams/.*/billing` endpoints are now available on a versioned path (e.g. `/v1/billing`)


6 changes: 6 additions & 0 deletions charts/nginz/templates/conf/_nginx.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,15 @@ http {
{{- if or (eq $env $.Values.nginx_conf.env) (eq $env "all") -}}

{{- if and (not (eq $.Values.nginx_conf.env "prod")) ($location.doc) -}}

rewrite ^/api-docs{{ $location.path }} {{ $location.path }}/api-docs?base_url=https://{{ $.Values.nginx_conf.env }}-nginz-https.{{ $.Values.nginx_conf.external_env_domain }}/ break;
{{- end }}

{{- if $location.strip_version }}

rewrite ^/v[0-9]+({{ $location.path }}) $1;
{{- end }}

{{- $versioned := ternary $location.versioned true (hasKey $location "versioned") -}}
{{- $path := printf "%s%s" (ternary "(/v[0-9]+)?" "" $versioned) $location.path }}

Expand Down
4 changes: 4 additions & 0 deletions charts/nginz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,13 @@ nginx_conf:
envs:
- all
disable_zauth: true
versioned: false
strip_version: true
- path: /teams/([^/]*)/billing(.*)
envs:
- all
versioned: false
strip_version: true
calling-test:
- path: /calling-test
envs:
Expand Down

0 comments on commit 998cec1

Please sign in to comment.