How to Enable CORS Headers for Your Application

Want to enable CORS Headers for your application on Cloudways? Here’s how you can do this.

S
Written by Syed Shabeeh Muhammad
Updated over a week ago

Cross-Origin Resource Sharing (CORS) allows domains to share resources with domains other than the original parent domain. As a security measure, a browser is restricted to only load resources that are located on the original domain. However, an application might require resources from other domains.


For this, Cloudways allows you to enable CORS Headers for your application so that domains mapped to and outside of Cloudways can share resources.

Here is how you can enable CORS Headers on Cloudways.

How to Enable CORS Headers

Step 1: Go to Applications

Log in to your account and click the Applications in the top header bar to see the list of active applications. Click the application on which you wish to enable CORS headers.

Step 2: Enable CORS Headers

From the left menu, click Application Settings to access the application settings screen. Set the toggle for the CORS header to Enable for your application. Click the OK button in the popup to confirm.

Important Notes

  • When enabled, CORS Headers are applicable on all the domains mapped to the application.

  • Enabling CORS Headers through the platform will override the CORS Headers entries in the .htaccess file or in the application web files.

  • At present, Cloudways only supports wildcard (*) CORS Headers.

  • CORS Headers are enabled on CloudwaysCDN by default. Use this option only if you have the need for cross-domain resource sharing at application-level domains.

  • There is no separate setting to enable/disable CORS Headers for CloudwaysCDN.

That’s it! We hope this article was helpful. If you need any help, then feel free to search your query on Cloudways Support Center or contact us via chat (Need a Hand > Send us a Message). Alternatively, you can also create a support ticket.

Did this answer your question?