1

Im new for the reverse proxy with Apache servers and I need to redirect my site to my web application. Here is the plan: I have that sub.domain.com that I want to redirect client to files under xampp/htdocs/mysite. Also I have that sub.domain.com/endpoint to redirect client to http://localhost:8080/mywebapp. Is it possible and if it is then how? Any help would be appreciated.

Talha ŞEKER
  • 11
  • 1
  • 4
  • 1
    You have three entries that match the *.80 AND the ServerName/ServerAlias (dashboard...). I think Apache is ignoring the second (which has the Proxy definition in it) and third. . – uSlackr Dec 23 '16 at 16:41

1 Answers1

0

Here are the entries to set up the proxy to another port

ProxyPass /endpoint http://sub.domain.com:8080/mywebapp
ProxyPassReverse /endpoint http://sub.domain.com:8080/mywebapp

You could skip the /endpoint path and use a servername (host header) to do the same thing:

<VirtualHost *:80>

    ServerName mywebapp
    ServerAlias mywebapp.domain.com



     ProxyPass / http://sub.domain.com:8080/mywebapp
     ProxyPassReverse / http://sub.domain.com:8080/mywebapp


</VirtualHost>

Your Config file has multiple entries that match on both the address/port and Servername/ServerAlias. I think apache is ignoring the second two. More on matching in the Apache Docs

uSlackr
  • 6,412
  • 21
  • 37