I have a very interesting question of possibility regarding sending a HTTP request through a private network and not the public internet. Honestly I have no idea where to start looking for help so I am posting in a few different places.
I have two servers, 1 & 2 with #2 being connected to our corporate VPN but does not publicly face the internet. #1 hosts my laravel application and I need to call a web service which runs on our corporate network.
Is there a way which I can specify when a controller asks for a json request from an internal only address to route through server #2?
Ideally I would not connect #1 to the VPN unless absolutely necessary.
Server #1 is Centos 7 running Plesk
Server #2 is Windows 2016
I’m not much of a network wizz but here are few ideas:
You do not need to be connected to internet at all. If you use IP in your browser your laravel app should respond depending on server configuration (plesk, nginx etc)
Controller does not ask for anything. Your webserver receives webrequests and processes it. If it finds matching route and that route relates to controller then it will be send there. In you controller or even before, in middleware, you can set it up in a way that only certain IP addresses can have access to this route.
Create an API, secure it with token and there should be no difference if you are on VPN or not.