This is an automated email from the ASF dual-hosted git repository. zike pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 7bf158d1e1c1762bc27329996c7636beb2326aa8 Author: Zike Yang <[email protected]> AuthorDate: Tue Feb 28 22:13:02 2023 +0800 Fix UI container cannot get the backend DNS correctly --- installer/default.conf | 77 ++++++++++++++++++++++++++ installer/k8s/templates/core/ui-configmap.yaml | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/installer/default.conf b/installer/default.conf new file mode 100644 index 000000000..84c17c484 --- /dev/null +++ b/installer/default.conf @@ -0,0 +1,77 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +server { + listen 80 default_server; + resolver 127.0.0.11; + + root /usr/share/nginx/html; + + # Enable gzip compression + gzip on; + gzip_static on; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_proxied any; + gzip_vary on; + gzip_comp_level 6; + gzip_buffers 16 8k; + gzip_http_version 1.1; + + # StreamPipes + + location /streampipes-backend { + set $upstream host.docker.internal:8030; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://$upstream; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + proxy_redirect off; + } + + location /streampipes-connect/ { + set $upstream host.docker.internal:8030; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://$upstream; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + } + + location ~/endpoints/(?<endpointName>.*)$ { + set $upstream host.docker.internal:8001/api/v1/worker/live/$endpointName; + + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-NginX-Proxy true; + proxy_pass http://$upstream; + proxy_ssl_session_reuse off; + proxy_set_header Host $http_host; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + #error_page 500 502 503 504 /50x.html; + #location = /50x.html { + # root /usr/share/nginx/html; + #} + +} diff --git a/installer/k8s/templates/core/ui-configmap.yaml b/installer/k8s/templates/core/ui-configmap.yaml index 4570fc226..31b2d3727 100644 --- a/installer/k8s/templates/core/ui-configmap.yaml +++ b/installer/k8s/templates/core/ui-configmap.yaml @@ -37,7 +37,7 @@ data: gzip_http_version 1.1; location /streampipes-backend { - set $upstream backend.sp-helmfile.svc.cluster.local:8030; + set $upstream backend.{{ .Release.Namespace }}.svc.cluster.local:8030; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
