D
D
DemonMortmael2020-11-28 10:42:19
linux
DemonMortmael, 2020-11-28 10:42:19

How to redirect from one IP to another in Linux?

Hello. There are two servers (both on CentOS) with different IPs. On one is Apache with a website, on the second is a server program that users connect to. I attached one domain to both and users should go through it both to the site and to the server. But the problem is that the server program itself apparently connects to a random IP from the list ... The site immediately gives out, but it becomes almost impossible to connect to the server using the domain, because the request is sent to the first one, where even the required port is not open.
Is it possible to somehow redirect using Apache (well, or by other means in Linux) from the first server directly to the desired port of the second?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dmitriev, 2020-11-28
@DemonMortmael

bind the domain only to the server with the program, raise nginx on it and set up a reverse proxy in it to the server with apache.
Optionally, if the site on apache is large and resources on the server with the program allow - add to nginx, for example, image caching.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question