# \[Payara 5.2020.5\] Enable CORS at server level?

**URL:** <https://forum.payara.fish/t/payara-5-2020-5-enable-cors-at-server-level/133>\
**Category:** Technical Discussion\
**Created:** [November 15, 2021, 1:29pm UTC](https://forum.payara.fish/t/payara-5-2020-5-enable-cors-at-server-level/133 "2021-11-15T13:29:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeeDev\_User](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@JeeDev\_User](https://forum.payara.fish/u/JeeDev_User)\
**Post date:** [November 15, 2021, 1:29pm UTC](https://forum.payara.fish/t/payara-5-2020-5-enable-cors-at-server-level/133/1 "2021-11-15T13:29:48Z")

</div>

Hi all,

Is there a way to enable CORS at server level somehow, as some param when servers start, or in some config file?

I know I can use custom ContainerResponseFilterfilter

> <https://github.com/payara/Payara-Examples/blob/master/demo-applications/kubernetes-example/backend/src/main/java/fish/payara/examples/kubernetes/backend/CorsFilter.java>

but wondering is there some other way?

(Payara 5.2020.5, community edition)

---

<div class="post-metadata">

**Author:** ![shubham.agrawal](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@shubham.agrawal](https://forum.payara.fish/u/shubham.agrawal)\
**Post date:** [November 20, 2021, 8:50pm UTC](https://forum.payara.fish/t/payara-5-2020-5-enable-cors-at-server-level/133/2 "2021-11-20T20:50:33Z")

</div>

Hi @JeeDev_User,

There is no explicit way to enable CORS at the server level. However, you can configure it through [web.xml](https://www.w3.org/wiki/CORS_Enabled#For_Jetty_.287_and_above.29) apart from Filter

Also, the Payara server has a feature that allows CORS headers support to Microprofile OpenAPI module- [Eclipse MicroProfile OpenAPI API :: Payara Community Documentation](https://docs.payara.fish/community/docs/documentation/microprofile/openapi.html#_command_options)
