Changing URL

Started by Newbie_oldie, October 09, 2020, 05:50:59 PM

Previous topic - Next topic

Newbie_oldie

Please bear with me - I'm a newbie to TomCat & Apache.
I've built a web server using TomCat 9, with Apache 2.4 as the front-end.  I can access my application with no issues using https://mywebservername.com/apps/f?p=myapp
My boss now wants to hide the web server behind another server (for security).  Users will access my application by typing in https://niceurlgoeshere.com/apps/f?p=myapp - this will take them to the new server which will forward requests to my web server.
If I type in https://niceurlgoeshere.com I reach the Tomcat front page (which is as I expect).  However, if I type in https://niceurlgoeshere.com/apps/f?p=myapp I get "can't find this page".
I've looked through the log files, that suggest that the request is being passed on by Apache, but then hitting a brick wall when it reaches TomCat (I can't see anything in the logs that points to an error, entries just seem to stop when the request reaches TomCat).  I've tried searching the internet for clues/pointers, but I'm now confused as to what I should be doing to get the new URL to work. Do I use proxy? proxy_html? proxypass? redirect? something else I haven't heard of yet?
Can someone point me in the right direction please?  (Please bear in mind I have no experience of Apache or TomCat, so keep your replies as jargon-free as possible :) )


Newbie_oldie

Solved  8)

For the benefit of those who may also have this dilemma, here's how I resolved this:

In my apache httpd-ssl.conf file:
1. I copied the existing Virtual Host block that I had created for mywebservername,com
2. In the new block I changed ServerName from mywebservername.com to niceURLgoeshere.com
3. In the new block I also set ProxPreserveHost Off
4. I restarted the Apache service, and I can now access my application using the niceURLgoeshere.com URL

I've kept the existing Virtual Host block in my httpd-ssl.conf file so that I have (for now) a 'backdoor' to the application.