charts/charts/netbox/templates/nginx-config.yaml
Alexander Olofsson 65b8221ae5
netbox: Update chart to version 2.9.10
NB; This is a larger change, especially for use with LDAP
2020-11-30 16:05:06 +01:00

76 lines
2 KiB
YAML

---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}-config-files
labels:
app.kubernetes.io/name: {{ include "netbox.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "netbox.chart" . }}
data:
{{- if .Values.useUnixSocket }}
gunicorn_config.py: |-
command = '/usr/bin/gunicorn'
pythonpath = '/opt/netbox/netbox'
bind = 'unix:/tmp/netbox/gunicorn.sock'
workers = 3
errorlog = '-'
accesslog = '-'
capture_output = False
loglevel = 'info'
{{- end }}
nginx.conf: |-
daemon off;
worker_processes 1;
error_log /dev/stderr info;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
gzip on;
server_tokens off;
client_max_body_size 10M;
upstream netbox {
{{- if .Values.useUnixSocket }}
server unix:/tmp/netbox/gunicorn.sock fail_timeout=0;
{{- else }}
server localhost:8001 fail_timeout=0;
{{- end }}
}
server {
listen 8080;
access_log off;
location /static/ {
alias /opt/netbox/netbox/static/;
}
location / {
proxy_pass http://netbox;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
server {
listen 8081;
access_log off;
location = /stub_status {
stub_status;
}
}
}