'AJAX / PHP file upload redirect or piping

I'm currently facing the following problem:

My web-app is hosted on a 3rd party webspace using an SSL certificate. On the backend side of things there's a NodeJS server running on a private server at my home. The way how I currently handle any sort of REST requests is by using PHP and cURL as a kind of middleware, which means the frontend (SSL) is AJAX-requesting the middleware located on the same server (SSL also), which is cURL-ing the local backend (non-SSL).

This way of achieving REST API behavior between these two instances works pretty well, but now I want to upload files. And that's where the problems start.

Is it possible to also use PHP as a middleware in this case and kind of pipe the file upload to the local backend? Or is there any other way to properly achieve this? Direct requests are (understandably) not allowed due to SSL-to-nonSSL restrictions, but I doubt this task shall be impossible to accomplish.

I would be really glad if anyone could come up with an idea for solving this headache - getting my private server SSL is (to my current knowledge) not possible at the moment.

Cheers



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source