CORS
When a resource is requested from another domain outside the domain from which the resource is originated, a cross-origin HTTP request is generated. For security purposes, the browser restricts the cross-origin HTTP request from being initiated from a script. If cross-origin resource sharing (CORS) is enabled, the web application server can control cross-origin requests, ensuring secure data transmission.
Configure the YAML file as follows:
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: ratings-route spec: hosts: - ratings.prod.svc.cluster.local http: - route: - destination: host: ratings.prod.svc.cluster.local subset: v1 corsPolicy: # Configure CORS. allowOrigins: - exact: https://example.com allowMethods: - POST - GET allowCredentials: false allowHeaders: - X-Foo-Bar maxAge: "24h"
You can configure the parameters based on site requirements.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot