Can a relative path be used in ProxyPass / ProxyPassReverse?

For example, in httpd.conf, the following configuration:

ProxyPass app http://somehost:someport/App_1 ProxyPassReverse app http://somehost:someport/App_1 

Now I have to use absolute URLs to forward requests from "/ myapp" to "/ app":

 <Location /myapp > ProxyPass http://localhost:8080/app ProxyPassReverse http://localhost:8080/app </Location> 

Can a relative path be used in ProxyPass / ProxyPassReverse?

 <Location /myapp > ProxyPass /app ProxyPassReverse /app </Location> 
+4
source share
1 answer

No.

apache docs about ProxyPass says the target should be a url. If you try to put something that is not a URL (e.g. /app ), you will get the following error:

ProxyPass URL must be absolute!

Instead, you should look for mod_rewrite . It can rewrite requests on the server without redirecting the browser. By providing the example / myapp → / app, simple rules would suffice, such as:

 RewriteRule ^/myapp /app [L] 
+2
source

Source: https://habr.com/ru/post/1390860/


All Articles