Score:0

I can't edit the url to remove the name of the app

cn flag

I am deploying an angular 13 application in a tomcat 9 environment.

This is the domain I am using: http://streamsspain.com/

And this is the result: http://streamsspain.com/streamsspain_web/

The problem that I find is that I use a proxy from apache2 in an Ubuntu 20 operating system, the redirection is done correctly on the tomcat server from the apache2 server, but I need to remove the name of the application from the url, which is "streamsspain_web/ ", I have tried using the corresponding rules to make a "RewirteRule" in apache2 but I can't find the exact ones.

Or maybe the url rewriting should be done in tomcat itself?

The apache conf is:

<VirtualHost *:80>
 ServerName streamsspain.com
 ServerAlias www.streamsspain.com

 ServerAdmin [email protected]

 ProxyRequests Off
 ProxyVia Off
 ProxyPreserveHost Off

 ProxyPass /StreamsSpain_WEB/ http://localhost:8180/StreamsSpain_WEB/
 ProxyPass / http://localhost:8180/StreamsSpain_WEB/
 ProxyPassReverse / http://localhost:8180/StreamsSpain_WEB/

 <Proxy *>
    Order deny,allow
    Allow from all
 </Proxy>

 ErrorLog ${APACHE_LOG_DIR}/Uploader_Image_error.log
 CustomLog ${APACHE_LOG_DIR}/Uploader_Image_access.log combined
</VirtualHost>
in flag
It is not clear when what redirect happens. Most probably you need to configure something like a baseurl in your application.
Score:0
cn flag

As you said, i think you should use the RewriteRule. By the way in the current conf file you are saying that no matter what i'm searching on browser between http://streamsspain.com/ and http://streamsspain.com/streamsspain_web/, i'll be redirected to the same service, but i'll receive response only from http://streamsspain.com/streamsspain_web/, because is the only one that has the ProxyPassReverse rule.

If my understaing it's right you want your service to be exposed on http://streamsspain.com/ without the application name. If this is the case i think you need one RewriteRule to just replace "streamsspain_web/" with an "empty string".

Then you need two rules (ProxyPass and ProxyPassReverse) for the forwarding.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.