0

I have an application setup for expanding a tiny URL. Once a hit is received from the browser, it will create a request in my Apache load balancer running on my domain. Let's assume my domain is "mydomain".

When the request comes to my Apache load balancer it should be translated to the URL: http://ip:port/MY_APP/myAdaptor/abcd

Tiny URL: http://mydomain.le/abcd

Expanded URL: http://ip:port/MY_APP/myAdaptor/abcd

The parameters are:

  • IP: IP of the server
  • port: port of the application
  • MY_APP: my deployed application
  • myAdaptor: my adaptor name
  • abcd: tiny URL

How can I configure this?

  • Hi, when I am hitting to mydomain.le/abcd this URL, I can reach up to ip:port/MY_APP/myAdaptor, but I need ip:port/MY_APP/myAdaptor/abcd. How I can achieve this – Arun Binoy Apr 4 '18 at 7:29
  • We still don't know anything about your setup. What tools are you using? How are they configured currently? Please edit your question. – gronostaj Apr 4 '18 at 8:14
  • The request is landing to apache load balancer, in workers.properties worker.APPSERVER1.port=16009 worker.APPSERVER1.host=10.0.0.93 worker.APPSERVER1.type=ajp13 , i have configured my tomcat application. But tiny url value not recieving to tomcat setup. – Arun Binoy Apr 4 '18 at 8:30
  • You realise this would be a lot easier to do if you dropped ajp and did http balancing, possibly with a bit of URL rewriting thrown in, right,? – davidgo Apr 4 '18 at 9:50
2

After adding below configuration in httpd.conf got the result as expected.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^/?([a-z]+) http://ip:port/MY_APP/myAdaptor/$1
</IfModule>

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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