HTML5 CORS with Apache2018-06-21T18:10:10+00:00

How to set CORS

Introduction

You can stream videos stored in other web servers with Airbroad Player.
Before streaming, CORS need to be set on departure server for resource sharing.
This tutorial shows how to set CORS on Apache web server.

Configuring Apache server (Ubuntu 16.04/Apache2)

1. open Apache server config file.

# vi /etc/apache2/apache2.conf

2. simply add the following lines inside either the <Directory>, <Location>, <Files> or <VirtualHost> sections. Example code below.

...
<Directory /var/www/html/your_directory>
     Header set Access-Control-Allow-Origin "http://your_domain"
     Header set Access-Control-Allow-Headers "Range"
     Header set Access-Control-Expose-Headers "Date, Content-range"
</Directory>
...

2. enable mod headers module and restart Apache server.

#
#
a2enmod headers
service apache2 restart

Configuring Other server

Please visit this page, if you want to set CORS on other web servers.