0

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 stalkingdragons@gmail.com

 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>

1 Answers1

0

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.