-
Notifications
You must be signed in to change notification settings - Fork 0
/
longhorn-nginx-config.yaml
69 lines (63 loc) · 2.19 KB
/
longhorn-nginx-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
apiVersion: v1
data:
nginx.conf: |-
events {
worker_connections 1024;
}
http {
server {
gzip on;
gzip_min_length 1k;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png image/svg+xml;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
include /etc/nginx/mime.types;
listen ${LONGHORN_UI_PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
location /v1 {
proxy_pass ${LONGHORN_MANAGER_IP};
proxy_request_buffering off;
client_max_body_size 0;
}
location / {
root /web/dist;
index index.html;
add_header Cache-Control "max-age=0";
try_files $uri $uri/ /index.html =404;
}
location ~ ^/.(images|javascript|js|css|flash|media|static)/ {
root /web/dist;
}
include /var/config/nginx/conf.d/*.conf;
}
}
kind: ConfigMap
metadata:
name: longhorn-nginxconfig
namespace: longhorn
---
apiVersion: v1
data:
nginx_add.conf: |-
auth_basic "Administrator’s Area";
auth_basic_user_file conf/htpasswd;
kind: ConfigMap
metadata:
name: longhorn-nginxconfig-add
namespace: longhorn