Answer the question
In order to leave comments, you need to log in
How to set up squid on VPS as a proxy for a server in LAN?
You need to set up the following configuration: the web server is located on a machine with ubuntu (let's call it server) in a local network with Internet access through a router. You need to set up a caching proxy server on a VPS with Ubuntu (let's call it vps) so that users from the Internet can see the website on the server. If everything is clear with setting up a web server, nginx and all things went up without problems, then with setting up a proxy on a VPS, not so much. What to put? Squid? I tried setting up a test transparent squid proxy on the standard port 3128 - everything seems to work, the web services show the proxy's IP address.
What to do next is not very clear. It is necessary that, when accessing http://vps:80 , the user would see the return on http://server:80.I understand that ssh tunneling is needed? I am extremely superficially familiar with it - I did it from the same server reverse ssh tunnel to vps.
I understand that there is a lot of information on this topic on the Internet, but it is precisely because of this that I am completely confused. In the tutorials, it's basically the other way around setting up squid for access from the local network to the Internet. It seems that the configuration that is interesting to me is not complicated and quite likely common, tell me where to find normal tutorials?
Answer the question
In order to leave comments, you need to log in
And if you need a caching proxy, then you can raise the VPN connection from Ubuntu to the VPS, for example using OpenVPN, and raise apache with mod_proxy on the VPS, which will redirect all requests from the outside to the VPS to Ubuntu.
I think nginx can also be used as a proxy instead of apache (most likely even better), but I won’t tell you here, I have never been involved in the web.
If I understood the task correctly, you need to forward the port from the local ubunta, which is behind nat on a VPS with a white ip. Squid is not needed here at all. In principle, an ssh tunnel will suffice. Read here about remote port forwarding and the sshd GatewayPorts option.
Well, it will look something like this:
From local Ubuntu, we forward its port 80 to the VPS through an ssh tunnel:ssh -R 80:local-address-ubuntu:80 [email protected]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question