Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created April 18, 2018 16:07
Show Gist options
  • Save dustinlacewell-wk/d0b8a7dbc9558e82d79d9ba66350f6c7 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/d0b8a7dbc9558e82d79d9ba66350f6c7 to your computer and use it in GitHub Desktop.
+ acl acl:{{$endpoint}}:is_options method OPTIONS
+ use_backend cors_backend if acl:{{$endpoint}}:is_options
+backend cors_backend
+ errorfile 503 /etc/haproxy/options.http
+HTTP/1.1 200 OK
+Access-Control-Allow-Headers: Origin, Accept, X-Session_id, Content-Type
+Access-Control-Allow-Origin: *
+Access-Control-Allow-Credentials: true
+Access-Control-Max-Age: 86400
+Access-Control-Allow-Methods: HEAD, DELETE, POST, GET, OPTIONS, PUT
+Connection: close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment