I got Apache Web Server 2.4, and a JBoss 7 exposing a web project.
Since I'm working locally I made an /etc/hosts/
domain entry like:
127.0.0.1 testmask
And put this virtual host config inside my Apache:
<VirtualHost *:80>
ServerName testmask/
ServerAlias testmask
RewriteEngine on
RewriteRule ^/$ http://testmask/MyWebapp/ [R]
ProxyPass / http://testmask:8080/
ProxyPassReverse / http://testmask:8080/
</VirtualHost>
And this works like a charm. If I put on browser:
testmask/
It redirects to:
http://testmask/MyWebapp/
So ok so far.
Now since I would like to have the same result but leaving only:
http://testmask/
I've made a proxy on rewrite rule:
RewriteRule ^/$ http://testmask/MyWebapp/ [P]
But I got a 404 not found problem on css and js that are relative to context root.
This is because my browser is trying to get css and js from:
http://testmask/static/
|- css/*
|- js/*
|- medias/*
while they are in:
http://testmask/MyWebapp/static/
|- css/*
|- js/*
|- medias/*
(typical folder structure of build\ReactJS create-react-app).
Tried different approaches via RewriteRules or Proxypass but nothing works, probably due to my poor experience on Apache.
Consider I prefer not to touch the index.html
since my projects need to live alone also, since I'm developing it via npm
.