CORS Not Working

Hi,

Have configured Allowed Headers in Cors plugin, but i’m not able to get Access-Control-Allow-Headers in response, due to which options pre-flight call is failing.

Is there any thing wrong on the cors plugin, or do i have to configure any other parameter.

FYI, have tried enabling cors plugin on route and as well as service, dint work.

@Irshad_G
Which kong version do you use? And do you use Kong Ingress Controller?
Please give more information about your configuration. It is better to get quick help.

@dieunb
Kong version : 2.0.3
Its community edition, installed on ubuntu with postgress

And could you show me the cors configuration? In my kong, cors plugin config is following below:

---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: demo-cors
  namespace: default
config:
  methods:
    - HEAD
    - GET
    - POST
    - PUT
    - PATCH
    - DELETE
  headers:
    - Authorization
    - Content-Type
  origins:
    - "*"
  credentials: true
plugin: cors

Please ensure that you have enable the plugin on a Kubernetes service or Ingress resource.
The following guide should help:

Would you share the error ?


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ