We’re trying to setup a 3scale platform over OpenShift to manage API access between a REST service and a JavaScript web application. Authentication shall be managed with the user-key placed in a HTTP header. The two applications are reachable on different URLs:
JS web application: http://siteA.example.com
REST API application: http://siteB.example.com
so we are using CORS to implement cross-origin resources on the webapp. This is introducing several OPTIONS pre-flight requests sent by the browser without the user-key header, thus receiving an HTTP 403 error from 3scale.
Is there a way to avoid this behaviour?
If you can't handle it at the application level then you can do a nginx if statement to handle it.
Via http://blog.rogeriopvl.com/archives/nginx-and-the-http-options-method/