Smart Site Developers Knowledgebase

How to set up CORS (cross-origin resource sharing) in Plesk for Linux?

Question

How to set up cross-origin resource sharing (CORS) in Plesk to display content from example1.com onexample.com?

Answer

Note: CORS is supported in the following browsers:  Chrome 3+, Firefox 3.5+, Opera 12+, Safari 4+, Internet Explorer 8+

  1. Log into Plesk UI on the server, where domain example.com is hosted.
  2. Navigate to the tab Domains > example.com > Apache and nginx settings and add the following directives to the section Additional directives for HTTP and to the section Additional directives for HTTPS: 

    border_plus_mceclip0.png
  3.  In case nginx as reverse proxy is enabled add the following nginx directive to Domains > example1.com > Apache and nginx settings > Additional nginx directives:

    border_plus_mceclip1.png
  4.  Click Apply to save settings.

Leave a Reply