Skip to content

Instantly share code, notes, and snippets.

@kameshsampath
Created August 2, 2021 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kameshsampath/4b9e8aa468d5d19c923f7cec4e5795f3 to your computer and use it in GitHub Desktop.
Save kameshsampath/4b9e8aa468d5d19c923f7cec4e5795f3 to your computer and use it in GitHub Desktop.
Allowing CORS Origins
apiVersion: gateway.solo.io/v1
kind: VirtualService
metadata:
name: fruits-api
namespace: my-gloo
spec:
displayName: FruitsAPI
virtualHost:
options:
cors:
allowOriginRegex:
- '^http(s)?:\/\/localhost:[0-9]{4,5}$'
maxAge: 1d
domains:
- '*'
routes:
- matchers:
- prefix: /
routeAction:
single:
destination:
upstream:
name: fruits-app-fruits-api-8080
namespace: my-gloo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment