0

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.

  • 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
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

  • it is not pretty simple and this does not work unfotunately. I tried that but both sub.domain.com and sub.domain.com/mywebapp directs browser to mywebapp – Talha ŞEKER Dec 23 '16 at 14:38
  • Im using vhost to serve my static web site under xampp/htdocs/mysite. Consider that please. – Talha ŞEKER Dec 23 '16 at 14:41
  • Perhaps you could add the portion your .conf file for the vhost. Also, what is in the error_log? BTW, Didn't mean anything by the "simple" comment. – uSlackr Dec 23 '16 at 16:13
  • you're right my bad here it is im editing and adding my vhost file – Talha ŞEKER Dec 23 '16 at 16:14
  • Thanks. For safety, you may want to anonymize that a bit. – uSlackr Dec 23 '16 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.