Skip to content

Commit 7e37365

Browse files
committed
[artifactory] allow custom nginx config files and snippets
This allows to add nginx config files and snippets to customize nginx behavior. An example use case would be, adding a config file containing log_formats and refering to one of those log_formats in a snippet setting a custom access_log.
1 parent 287b78b commit 7e37365

6 files changed

Lines changed: 24 additions & 0 deletions

File tree

stable/artifactory-ha/files/nginx-artifactory-conf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@ location / {
144144
{{- end }}
145145
}
146146
}
147+
{{- if .Values.nginx.customServerSnippet }}
148+
{{ .Values.nginx.customServerSnippet }}
149+
{{- end }}
147150
}

stable/artifactory-ha/templates/nginx-artifactory-conf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ data:
1515
{{- else }}
1616
{{ tpl ( .Files.Get "files/nginx-artifactory-conf.yaml" ) . | indent 4 }}
1717
{{- end }}
18+
{{- if .Values.nginx.customConfFile }}
19+
{{ tpl .Values.nginx.customConfFile . | indent 2 }}
20+
{{ end }}
1821
{{- end }}

stable/artifactory-ha/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,12 @@ nginx:
19471947
## allows overwriting the command for the nginx container.
19481948
## defaults to [ 'nginx', '-g', 'daemon off;' ]
19491949

1950+
customConfFile: ""
1951+
# custom.conf: |
1952+
# log_format ningxartifactory '$proxy_protocol_addr - $remote_user [$time_local] "$request"';
1953+
customServerSnippet: ""
1954+
# access_log /dev/stdout ningxartifactory;
1955+
19501956
service:
19511957
## For minikube, set this to NodePort, elsewhere use LoadBalancer
19521958
type: LoadBalancer

stable/artifactory/files/nginx-artifactory-conf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,7 @@ location / {
144144
{{- end }}
145145
}
146146
}
147+
{{- if .Values.nginx.customServerSnippet }}
148+
{{ .Values.nginx.customServerSnippet }}
149+
{{- end }}
147150
}

stable/artifactory/templates/nginx-artifactory-conf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,7 @@ data:
1515
{{- else }}
1616
{{ tpl ( .Files.Get "files/nginx-artifactory-conf.yaml" ) . | indent 4 }}
1717
{{- end }}
18+
{{- if .Values.nginx.customConfFile }}
19+
{{ tpl .Values.nginx.customConfFile . | indent 2 }}
20+
{{ end }}
1821
{{- end }}

stable/artifactory/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,12 @@ nginx:
18511851
## allows overwriting the command for the nginx container.
18521852
## defaults to [ 'nginx', '-g', 'daemon off;' ]
18531853

1854+
customConfFile: ""
1855+
# custom.conf: |
1856+
# log_format ningxartifactory '$proxy_protocol_addr - $remote_user [$time_local] "$request"';
1857+
customServerSnippet: ""
1858+
# access_log /dev/stdout ningxartifactory;
1859+
18541860
service:
18551861
## For minikube, set this to NodePort, elsewhere use LoadBalancer
18561862
type: LoadBalancer

0 commit comments

Comments
 (0)