V
V
Vladimir Kiselyov2016-04-11 15:12:04
Computer networks
Vladimir Kiselyov, 2016-04-11 15:12:04

Port forwarding (http, 80) to another server, while maintaining the client's IP address?

Tried via forward postroutiong prerouting
but httpd always gets the same ip address.
Subtracted what is necessary through mangle and route.
The experiments came to nothing.
There is a gateway machine ip 10.10.9.99.
machine where to spin httpd 10.10.1.111.
Visitors enter the gateway machine at 10.10.9.99:80
and it redirects them to 10.10.1.111:80 while transmitting the client's IP.
Tell me where to write?
PS httpd_proxy is not suitable because, in addition to http, other services must also be forwarded.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Selivanov, 2016-04-11
@selivanov_pavel

proxy:

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

backend:
real_ip_header X-Forwarded-For;
set_real_ip_from <proxy_ip>;

UPD: This is for nginx. I did not notice that the question was httpd, that is, most likely Apache.

V
Vyacheslav Alekseev, 2016-04-11
@AlexeevVyacheslav

yes, nginx is able to pass all request headers to the receiving server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question