문제

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
도움이 되었습니까?

해결책

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]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top