Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
92 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...