|
| 1 | +{{- if .Values.components.reana_ui.enabled }} |
| 2 | +--- |
| 3 | +apiVersion: v1 |
| 4 | +kind: ConfigMap |
| 5 | +metadata: |
| 6 | + name: nginx-config |
| 7 | + namespace: {{ .Release.Namespace }} |
| 8 | +data: |
| 9 | + reana-ui.conf: | |
| 10 | + server { |
| 11 | + listen 80; |
| 12 | + root /usr/share/nginx/html; |
| 13 | + server_name localhost; |
| 14 | + index index.html index.htm; |
| 15 | +{{- with .Values.components.reana_ui.nginx.security_headers.hsts }} |
| 16 | + add_header Strict-Transport-Security "{{ . }}" always; |
| 17 | +{{- end }} |
| 18 | +{{- with .Values.components.reana_ui.nginx.security_headers.x_frame_options }} |
| 19 | + add_header X-Frame-Options "{{ . }}" always; |
| 20 | +{{- end }} |
| 21 | +{{- with .Values.components.reana_ui.nginx.security_headers.x_content_type_options }} |
| 22 | + add_header X-Content-Type-Options "{{ . }}" always; |
| 23 | +{{- end }} |
| 24 | +{{- with .Values.components.reana_ui.nginx.security_headers.cross_origin_opener_policy }} |
| 25 | + add_header Cross-Origin-Opener-Policy "{{ . }}" always; |
| 26 | +{{- end }} |
| 27 | +{{- with .Values.components.reana_ui.nginx.security_headers.cross_origin_resource_policy }} |
| 28 | + add_header Cross-Origin-Resource-Policy "{{ . }}" always; |
| 29 | +{{- end }} |
| 30 | +{{- with .Values.components.reana_ui.nginx.security_headers.referrer_policy }} |
| 31 | + add_header Referrer-Policy "{{ . }}" always; |
| 32 | +{{- end }} |
| 33 | +{{- with .Values.components.reana_ui.nginx.security_headers.permissions_policy }} |
| 34 | + add_header Permissions-Policy "{{ . }}" always; |
| 35 | +{{- end }} |
| 36 | +{{- with .Values.components.reana_ui.nginx.security_headers.csp }} |
| 37 | + # NOTE: keep in sync with reana-server config.py content security policy headers |
| 38 | + add_header Content-Security-Policy "{{ . }}" always; |
| 39 | +{{- end }} |
| 40 | + |
| 41 | + #Enable serving of pre-compressed files |
| 42 | + gzip_static on; |
| 43 | + |
| 44 | + location / { |
| 45 | + try_files $uri /index.html; |
| 46 | + } |
| 47 | + location = /index.html { |
| 48 | + # If the file for the requested URL does not exist, then `/index.html` is always |
| 49 | + # served. This might cause some issues given that `index.html` is cached by |
| 50 | + # the browser (e.g. in case of an URL to an interactive session). |
| 51 | + # This setting makes sure that `index.html` is revalidated on each request. |
| 52 | + expires -1; |
| 53 | + } |
| 54 | + } |
| 55 | +{{- end }} |
0 commit comments