Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
97 views
in Technique[技术] by (71.8m points)

php - How To Forwarding All Request To Private Back End

here is the topology, I'm use only vue js for front end and Laravel as back end

  1. Back End/API Server (Intranet/Private access) Laravel
  2. Admin Front End (Intranet/Private access) Vue
  3. Public Front End (Internet/Public access) Vue

All of front end server can access the Back End server

The problems is with the public front end, because I think vue is client side, so the client can't get access to the API server,

So with this problems I have one solution to make server side web app (Laravel) on the public front end to make / send request to back end server, and the vue on the public server access this server side

my question is

  1. How can I forward all the request from vue in public, to server side, and the server side make request to back end. Can I make request simple request like this ?, because I use form data on front end

    $photo = fopen('photo.jpg', 'r');

    $response = Http::attach( 'attachment', $photo, 'photo.jpg' )->post('http://the-back-end-server/');

  2. How about to access the image, because the image was saved on back end, how can I access it from public front end ?

  3. Or maybe anyone have another solution ?

Thanks

Thanks, sorry for my bad english

question from:https://stackoverflow.com/questions/65859210/how-to-forwarding-all-request-to-private-back-end

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...