Question

I have url like this http://myste.com/n/marketplace Where http://myste.com - is a java app, /n/ - is node instance, /marketplace - one of the nodes routes.

How to configure apache so that route http://myste.com/marketplace was the same as http://myste.com/n/marketplace?

I will be having node routes like http://myste.com/n/marketplace and http://myste.com/n/tips with their respective namespaces.

How do I get rid of /n/? And what the relative path to public static files would be?

I've tried something like this, and it worked except my static files were not found.

ProxyPass    /marketplace    http://localhost:3000/marketplace
ProxyPassReverse /marketplace    http://localhost:3000/marketplace

ProxyPass    /tips    http://localhost:3000/tips
ProxyPassReverse /tips    http://localhost:3000/tips
Was it helpful?

Solution

mod_proxy doesn't allow you manipulate the requested URL.

You'd be better off using the proxy switch in mod_rewrite rather than mod_proxy.

RewriteRule ^/(.*)$ http://localhost:3000/$1 [P,QSA,L]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top