1

Is it possible for a RPi server to serve from another RPi on the same network?

I have 2 RPi's on my home network, both running apache servers - Raspberry A is linked to a web domain i.e. mydomain.net, and the router redirects incoming http/https calls to it; Raspberry B is only available inside the network at network IP 192.168.1.123. If possible I'd like to create a html/php page on Raspberry A that relays calls to/from Raspberry B's network IP. Grateful for any advice on how to achieve this.

asked Feb 6, 2017 at 16:12
1
  • IHMO - no simple way -try to read this... docs.trafficserver.apache.org/en/4.2.x/admin/… However, I would create a simple python webserver on B that - each call - would make a call to A and copied the response. Commented Feb 6, 2017 at 16:54

1 Answer 1

1

You are talking about a reverse proxy. The apache docs explain it in detail here : https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

Essentially, you need mod_proxy enabled and then you can use the ProxyPass directive.

Example (from the docs):

ProxyPass "/images" "http://www.example.com/" ProxyPassReverse "/images" "http://www.example.com/"

In the above, any requests which start with the /images path with be proxied to the specified backend, otherwise it will be handled locally.

Note: The ProxyPassReverse is used to make sure that the displayed URLs that make it back to the client are for the proxy not the (unreachable directly) back end server.

answered Feb 6, 2017 at 22:36
2
  • Just picking this up again. The guidance seems to leave quite a bit inferred. Where is this example supposed to go - /etc/apache2/apache2.conf? Inside directory tags? Do I need to create a directory in web path to link the setting to? Does it need to include anything? I'm probably over-complicating it, but this documentation does seem light.. Commented Feb 22, 2017 at 1:35
  • In sites-available/default (or the .conf file for the particular site, if you're hosting multiple) inside the <VirtualHost> element create a <Location> element and add the two directive above inside that. Commented Feb 22, 2017 at 8:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.