- Plesk 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>p
Header always set Access-Control-Allow-Origin "example.com"
If Nginx is enabled and static content needed to be displayed, use the following directive in Additional nginx directives field without Apache directives:
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