For example there is following configuration in httpd.conf:
ProxyPass app http://somehost:someport/App_1
ProxyPassReverse app http://somehost:someport/App_1
Now I should use absolute urls to forward requests from "/myapp" to "/app":
<Location /myapp >
ProxyPass http://localhost:8080/app
ProxyPassReverse http://localhost:8080/app
</Location>
Is it possible to use relative path in ProxyPass/ProxyPassReverse?
<Location /myapp >
ProxyPass /app
ProxyPassReverse /app
</Location>
No.
The apache docs about ProxyPass says the target must be a URL. If you try to put something that isn't a URL (like /app
), you get the following error:
ProxyPass URL must be absolute!
You should look into mod_rewrite instead. It can rewrite requests on the serverside without redirecting the browser. Giving your /myapp -> /app example, some simple rules such as this would suffice:
RewriteRule ^/myapp /app [L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With