A
A
Artem2019-11-01 22:15:01
linux
Artem, 2019-11-01 22:15:01

How to forward a local HTTP server through a remote server?

Initial data:
- There is a home server on Debian for a smart home in the local network. Installed Apache
- Gray IP from the provider
- Remote server also on Debian with several sites and the ability to configure as needed
Task: to provide access to several HTTP pages from the home server from the outside by somehow proxying them on the remote server.
How can I do that? There will be few requests, I don’t want to fence a complex system, I also don’t want to install a lot of software on a remote server that is not related to the main activity.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2019-11-02
@bartwell

Yes, indeed, everything is extremely simple:
1. On the remote server, set GatewayPorts yes in /etc/ssh/sshd_config
2. On the home server , type
ssh -f -N -R 1111:localhost:80 domain.ru [email protected]
where 1111 - port on the remote server, domain.ru - address of the remote server, user - user on the remote server.
Thanks Alex Ten .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question