-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mount nginx.conf as a volume to the frontend container
- Loading branch information
1 parent
c810b37
commit 38c1121
Showing
4 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{{- if .Values.opencost.ui.enabled }} | ||
{{- $serviceName := include "opencost.fullname" . -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: opencost-ui-nginx-conf | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
nginx.conf: | | ||
gzip_static on; | ||
gzip on; | ||
gzip_min_length 50000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types | ||
application/atom+xml | ||
application/geo+json | ||
application/javascript | ||
application/x-javascript | ||
application/json | ||
application/ld+json | ||
application/manifest+json | ||
application/rdf+xml | ||
application/rss+xml | ||
application/vnd.ms-fontobject | ||
application/wasm | ||
application/x-web-app-manifest+json | ||
application/xhtml+xml | ||
application/xml | ||
font/eot | ||
font/otf | ||
font/ttf | ||
image/bmp | ||
image/svg+xml | ||
text/cache-manifest | ||
text/calendar | ||
text/css | ||
text/javascript | ||
text/markdown | ||
text/plain | ||
text/xml | ||
text/x-component | ||
text/x-cross-domain-policy; | ||
upstream model { | ||
{{- if .Values.opencost.ui.useDefaultFqdn }} | ||
server {{ $serviceName }}.{{ .Release.Namespace }}.svc.cluster.local:9003; | ||
{{- else if .Values.opencost.ui.modelFqdn }} | ||
server {{ .Values.opencost.ui.modelFqdn }}; | ||
{{- else }} | ||
server {{ $serviceName }}.{{ .Release.Namespace }}:9003; | ||
{{- end }} | ||
} | ||
server { | ||
server_name _; | ||
root /var/www; | ||
index index.html; | ||
large_client_header_buffers 4 32k; | ||
add_header Cache-Control "must-revalidate"; | ||
error_page 504 /custom_504.html; | ||
location = /custom_504.html { | ||
internal; | ||
} | ||
add_header Cache-Control "max-age=300"; | ||
location / { | ||
root /var/www; | ||
index index.html index.htm; | ||
try_files $uri /index.html; | ||
} | ||
add_header ETag "1.96.0"; | ||
listen {{ .Values.opencost.ui.uiPort }}; | ||
listen [::]:{{ .Values.opencost.ui.uiPort }}; | ||
resolver 127.0.0.1 valid=5s; | ||
location /healthz { | ||
access_log /dev/null; | ||
return 200 'OK'; | ||
} | ||
location /model/ { | ||
proxy_connect_timeout 180; | ||
proxy_send_timeout 180; | ||
proxy_read_timeout 180; | ||
proxy_pass http://model/; | ||
proxy_redirect off; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters