Reputation: 53
We are hosting websites on a server with CentOS and Plesk. For one of the websites we would like to enable CORS for a partner that wants to show specific content from our website on his own website.
How do I have to proceed for that and is CORS really save? I read some tutorials but they were to common to help me.
Again our server information:
Server: CentOS
Admin software: Plesk 11.5
CMS: Contao
Our partner only wants to grab content from our website, there is no other interaction needed (sending data over our website e.g.).
Thank´s for your help!
Upvotes: 4
Views: 6245
Reputation: 10312
You can add custom web server directives at domain's "Web Server Settings" page.
There is "Additional Apache directives" and "Additional nginx directives"
For example, to add "Access-Control-Allow-Origin" header for nginx you need "add_header", as described in docs http://nginx.org/en/docs/http/ngx_http_headers_module.html it can be applied to http, virtual server or location.
So, you just can add following string at "Additional nginx directives":
add_header Access-Control-Allow-Origin *;
Upvotes: 2