Fix reverse proxy shows 404 not found when Istio enabled (#1377)

Istio sidecar proxy blocks all requests sent through the reverse proxy
to the target service if the request.Host is not properly set to the
internal target service host. This PR sets the target service hosts
before establishing the proxy for the client in order to pass the
Istio sidecar proxy check.
This commit is contained in:
Ta-Ching Chen
2019-11-04 21:59:40 +08:00
committed by GitHub
parent f288f0f258
commit c33f1e112e
5 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -27,6 +27,7 @@ import (
"time"
influxdbClient "github.com/influxdata/influxdb/client/v2"
"github.com/pkg/errors"
ferror "github.com/fission/fission/pkg/error"
"github.com/fission/fission/pkg/fission-cli/log"
@@ -143,7 +144,7 @@ func (influx InfluxDB) query(query influxdbClient.Query) (*influxdbClient.Respon
queryURL.Path = path.Clean(fmt.Sprintf("%s/proxy/%s", queryURL.Path, INFLUXDB))
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
return nil, errors.Wrap(err, "error creating request for log proxy")
}
parametersBytes, err := json.Marshal(query.Parameters)