Commit b9545971 by ningfd

Update cfg-kpl-nginx.yaml.j2

1 parent 0b075ec4
Showing with 18 additions and 2 deletions
...@@ -99,10 +99,11 @@ data: ...@@ -99,10 +99,11 @@ data:
ssl_prefer_server_ciphers on; ssl_prefer_server_ciphers on;
location / { location / {
resolver kube-dns.kube-system.svc.cluster.local valid=5s; resolver {{ K8S_DNS_SVC }} valid=5s;
proxy_pass http://kpl--frontend.kpl.svc.cluster.local:80$request_uri; proxy_pass http://kpl--frontend.kpl.svc.cluster.local:80$request_uri;
} }
location /api { location /api {
resolver {{ K8S_DNS_SVC }} valid=5s;
proxy_pass http://kpl--backend:8919/api/v1/deploy/api; proxy_pass http://kpl--backend:8919/api/v1/deploy/api;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_connect_timeout 10s; proxy_connect_timeout 10s;
...@@ -138,6 +139,20 @@ data: ...@@ -138,6 +139,20 @@ data:
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
} }
location ^~ /edu/v1 {
resolver {{ K8S_DNS_SVC }} valid=5s;
proxy_pass http://kpl--edu.kpl.svc.cluster.local:8919$request_uri;
proxy_set_header Host $host;
proxy_connect_timeout 10s;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ~ /jupyterlab/proxy/([-_.:\w]+)/(.*) { location ~ /jupyterlab/proxy/([-_.:\w]+)/(.*) {
resolver {{ K8S_DNS_SVC }} valid=5s; #修改成自己环境dns组件service名字 resolver {{ K8S_DNS_SVC }} valid=5s; #修改成自己环境dns组件service名字
rewrite_log on; rewrite_log on;
...@@ -152,7 +167,7 @@ data: ...@@ -152,7 +167,7 @@ data:
} }
location ~ /tensorboard/proxy/([-_.:\w]+)/(.*) { location ~ /tensorboard/proxy/([-_.:\w]+)/(.*) {
resolver kube-dns.kube-system.svc.cluster.local valid=5s; resolver {{ K8S_DNS_SVC }} valid=5s;
rewrite_log on; rewrite_log on;
rewrite ^/tensorboard/proxy/([-_.:\w]+)/(.*) /$2 break; rewrite ^/tensorboard/proxy/([-_.:\w]+)/(.*) /$2 break;
proxy_pass http://$1.autodl.svc.cluster.local:9999; proxy_pass http://$1.autodl.svc.cluster.local:9999;
...@@ -163,6 +178,7 @@ data: ...@@ -163,6 +178,7 @@ data:
} }
location /grafana { location /grafana {
resolver {{ K8S_DNS_SVC }} valid=5s;
root html; root html;
index index.html index.htm; index index.html index.htm;
add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Origin' '*';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!