Try to share folder. PHP Error: failed to open stream HTTP

Hello.

I’m trying to share a new “transfert” folder “/usr/share/jitsi-meet/transfert” and download a simple text file “index.txt” from another server with PHP.

I don’t want to download from secure connection (SSL).

In /etc/nginx/sites-enabled/myjitsiserver.com.conf , I have

server {

  • listen 80;*

  • listen [::]:80;*

  • server_name myjitsiserver.com;*

  • location /transfert/ { }*

  • location ^~ /.well-known/acme-challenge/ {*

  •   default_type "text/plain";*
    
  •   root         /usr/share/jitsi-meet;*
    
  • }*

  • location = /.well-known/acme-challenge/ {*

  •   return 404;*
    
  • }*

  • location / {*

  •   return 301 https://$host$request_uri;*
    
  • }*
    }

In my transfert directory I have files like “index.txt”, plain text file list like this :
jicofo-20200624.log
jicofo-20200625.log
jicofo-20200626.log

On my other server, I’m trying to download this file using PHP file_get_contents function :
*<?php *
$config = array(

  • “ssl”=> array(*
  •    "verify_peer"=>false,*
    
  •    "verify_peer_name"=>false,*
    
  • ),*
    *); *
    $context = stream_context_create($config);
    $result=file_get_contents(“http://myjitsiserver.com/transfert/index.txt”, false, $context);
    echo $result;
    ?>

And I’m always getting this error :

Warning* : file_get_contents(http ://myjitsiserver.com/transfert/index.txt): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\Program Files (x86)\EasyPHP-Devserver-17\eds-www\index.php on line *9

When I’m using a browser, the default configuration of jitsi/nginx just transfert http ://myjitsiserver/transfert/index.txt to the secure http ://myjitsiserver/transfert/index.txt page.

When I add location /transfert/ { } in my nginx config file I have, the first time, an error 404 Not found (nginx). And if I reload the page, I have the file content but I’m with the HTTPS page.

How can we access an unique unsecure folder and read file from another server (another domain) ?

Thanks.

Eric