ad48
ad48

Reputation: 83

Redirecting on server side in Apache

If this question is unclear or doesn't belong here/is duplicate,let me know.

I have run two servers:one (Apache) on port 80,and second (custom) on port 81. Now,the custom server is used for some scripting and only listening on /cgi-bin/

Now,i ported my Apache server to a custom url abc.xyz,and added

<VirtualHost *:80>
Redirect "/cgi-bin/" "http://127.0.0.1:81/cgi-bin/"
</VirtualHost>

However,as i go on abc.xyz/cgi-bin/somescript,it redirects me to localhost:81/cgi-bin/somescript on client side. And as you know,the server on localhost can be acessed only through my computer.

It is somehow possible to redirect a request on server side instead of client ?

Upvotes: 2

Views: 135

Answers (1)

JorgenPhi
JorgenPhi

Reputation: 108

What you are looking for is not for Apache to serve a redirect, but for Apache to act as a reverse proxy.

ProxyPass "/cgi-bin/" "http://127.0.0.1:81/cgi-bin/" should work for you.

Upvotes: 2

Related Questions