- Plesk 12.5 for Linux
- Plesk Onyx for Linux
How to set up cross-origin resource sharing (CORS) in Plesk to display content from example1.com on example.com ?
On the source server where domain example1.com is hosted, go to Domains > example1.com > Apache and nginx settings and add the following directives in Additional directives for HTTP and Additional directives for HTTPS:
CONFIG_TEXT: Header set Access-Control-Allow-Origin "example.com"
Alternatively, in this case
file with the following content can be used:
CONFIG_TEXT: <IfModule mod_headers.c>
Header always set Access-Control-Allow-Origin "example.com"
If nginx is enabled and static content needed to be displayed, additionally add the following directive to Additional nginx directives field:
CONFIG_TEXT: add_header Access-Control-Allow-Origin "example.com";
Note: CORS is supported in the following browsers:
Internet Explorer 8+
To learn more about implementing CORS for a specific platform check Enable CORS website