[SOLVED] Apache2 - Redirect a /specific/path to a different port
by dr-ing from LinuxQuestions.org on (#59PA5)
Hey,
My scenario is quite simple, but I don't know a good solution for my problem:
My server runs with Apache2 and is only reachable over one (!) IP. I have two backend applications with two different APIs on the server, and I need to access both of them over the same IP using the same port (80). One of the backend applications (the new one) has its own web server, the other (old one) is called by Apache2 via cgi-bin. So for example I can access the old backend via 10.0.0.1/cgi-bin/old_backend and the new one via 10.0.0.1/new_backend. The second call must be redirected to the webserver of the backend.
My problem is that for the first/old backend (/cgi-bin/old_backend) I need the set the headers in Apache2 config to work correctly. For the second/new (/new_backend) the web server of the backend sets the headers itself, so I have to tell Apache2 not to set its headers when it is called via this path (otherwise I have duplicate headers in the server response, which is a problem for my frontend application).
Does anyone know a simple solution how to handle this with Apache2?
TIA,
dr-ing


My scenario is quite simple, but I don't know a good solution for my problem:
My server runs with Apache2 and is only reachable over one (!) IP. I have two backend applications with two different APIs on the server, and I need to access both of them over the same IP using the same port (80). One of the backend applications (the new one) has its own web server, the other (old one) is called by Apache2 via cgi-bin. So for example I can access the old backend via 10.0.0.1/cgi-bin/old_backend and the new one via 10.0.0.1/new_backend. The second call must be redirected to the webserver of the backend.
My problem is that for the first/old backend (/cgi-bin/old_backend) I need the set the headers in Apache2 config to work correctly. For the second/new (/new_backend) the web server of the backend sets the headers itself, so I have to tell Apache2 not to set its headers when it is called via this path (otherwise I have duplicate headers in the server response, which is a problem for my frontend application).
Does anyone know a simple solution how to handle this with Apache2?
TIA,
dr-ing