We've got a Java server running on Tomcat8 on AWS ElasticBeanStalk. The project contains an AngularJS webapp as frontend. Our frontend webapp is accessible by www.domain.com/webappName. I put a .conf file in .ebextensions/httpd/conf.d in my root directory.
Here's the content of my conf.d (rule redirect to a new url with new version of frontend, in Angular7)
<VirtualHost *:80>
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/webappname/index\.html
RewriteRule ^webappname/index\.html(.*)$ https://redirect-domain.com/$1 [R=301,L]
<Proxy *>
Require all granted
</Proxy>
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost on
ErrorLog /var/log/httpd/elasticbeanstalk-error_log
</VirtualHost>
But rewriting not working. I tested my rule in localhost and on an online simulator and it was working fine. But when we deploying our War file on AWS ElasticBeanStalk, it's not working.
Do you know why ? It's look like the configuration file is bypassed. I tried with AllowOverride All
but it doesnt work.
Our ElasticBeanStalk is running with Tomcat8, Java8 and Apache 3.3.2.