-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[maykinmedia/open-klant#299] Add nginx
- Loading branch information
1 parent
7ae07ca
commit d8cbe1b
Showing
9 changed files
with
352 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
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,86 @@ | ||
{{- if not .Values.nginx.existingConfigmap }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "openklant.nginxFullname" . }} | ||
labels: | ||
{{- include "openklant.nginxLabels" . | nindent 4 }} | ||
data: | ||
proxy: | | ||
proxy_pass_header Server; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Scheme $scheme; | ||
proxy_connect_timeout 300s; | ||
proxy_read_timeout 300s; | ||
{{- if .Values.settings.useXForwardedHost }} | ||
proxy_set_header X-Forwarded-Host $http_host; | ||
{{ else }} | ||
proxy_set_header Host $http_host; | ||
{{- end }} | ||
proxy_redirect off; | ||
proxy_pass_request_headers on; | ||
proxy_pass http://{{ include "openklant.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}; | ||
proxy_http_version 1.1; # required if you're using istio, otherwise you get HTTP 426 errors | ||
default.conf: | | ||
server { | ||
listen 8000 default_server; | ||
server_name {{ .Values.settings.allowedHosts | replace "," " "}} localhost; | ||
server_tokens off; | ||
client_max_body_size {{ .Values.nginx.config.clientMaxBodySize }}; | ||
gzip on; | ||
gzip_http_version 1.0; | ||
gzip_comp_level 2; | ||
gzip_min_length 1100; | ||
gzip_buffers 4 8k; | ||
gzip_proxied any; | ||
gzip_types | ||
# text/html is always compressed by HttpGzipModule | ||
text/css | ||
text/javascript | ||
text/xml | ||
text/plain | ||
text/x-component | ||
application/javascript | ||
application/json | ||
application/xml | ||
application/rss+xml | ||
font/truetypenginc | ||
font/opentype | ||
application/vnd.ms-fontobject | ||
image/svg+xml; | ||
gzip_static on; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_disable "MSIE [1-6]\."; | ||
gzip_vary on; | ||
add_header Feature-Policy "autoplay 'none'; camera 'none'" always; | ||
add_header Referrer-Policy "same-origin"; | ||
add_header X-Content-Type-Options "nosniff"; | ||
add_header X-XSS-Protection "1; mode=block"; | ||
location / { | ||
include conf.d/proxy; | ||
} | ||
location /_health/ { | ||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log error; | ||
return 200 'OK'; | ||
} | ||
location /private-media { | ||
internal; | ||
alias /app/private_media/; | ||
} | ||
error_page 404 /404.html; | ||
error_page 413 /413.json; | ||
error_page 500 502 503 504 /500.json; | ||
} | ||
{{- 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
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,15 @@ | ||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ include "openklant.fullname" . }} | ||
labels: | ||
{{- include "openklant.labels" . | nindent 4 }} | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
storageClassName: {{ .Values.persistence.storageClassName }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.persistence.size }} | ||
{{- 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
Oops, something went wrong.