Skip to main content

Enable CORS on Marketplace VM

CORS with the configuration below is already enabled for version CE (both Marketplace/compose and Docker) 2.12.10 an up.

For Flexify.IO versions prior to 2.12.10, CORS can be enabled on Flexify.IO Community Edition marketplace image by modifying nginx configuration.

  1. Edit /etc/flexify/nginx/engine-location.conf and add following lines:

location / {
if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods *;
add_header Access-Control-Allow-Headers *;
add_header Access-Control-Max-Age 1800;
return 200;
}

add_header Access-Control-Allow-Origin * always;

...
}

2. Restart the VM or just nginx:

docker-compose restart web