I'm currently running a main server from a raspberry pi (32 GB) and a secondary server (4 TB) running as the file storage server. Both servers are running Debian Linux with Apache2 installed. I've been successful to bring PHP output from secondary server to main server with this code:
<?php $results = file_get_contents('http://example.org:700/handle.php'); echo $results; ?>
<?php header('Access-Control-Allow-Origin: http://example.org'); //Rest of code ?>
<IfModule mod_headers.c> Header set Access-Control-Allow-Origin: "http://example.org" Header set Access-Control-Allow-Credentials: true Header set Access-Control-Expose-Headers: "Content-Length" Header set Access-Control-Allow-Methods: "POST, GET, PUT, OPTIONS, DELETE, HEAD" Header set Access-Control-Allow-Headers: "Content-Length" </IfModule>
Right now I get this error from google chrome:
XMLHttpRequest cannot load http://example.org:700/song.flac. Request header field Range is not allowed by Access-Control-Allow-Headers in preflight response.
I simply want to allow all traffic between the two servers to be secure and with no XMLHttpRequest errors. Is there something I can change in the config file to make this work?