How to pass arguments through ProxyPass in Apache
ProxyPass only operates on the part of the URL matched, and not on the query string. IF you include the query string in the pattern you will never get a match.
So in order to do what you want you would use something like:
ProxyPass /index.php/info https://1.2.3.4:567/index.php/info
Although in this case you probably could even use:
ProxyPass / https://1.2.3.4:567/
Basically see proxypass as a sort of "search and replace". "ProxyPass A B" basically means "find A in the URL en if found, replace with B".
Related videos on Youtube
Lisek
Updated on September 18, 2022Comments
-
Lisek almost 2 years
What I'm trying to do and I've got stuck is:
I've got apache server that will catch certain url's and for some of them, he will use ProxyPass (or mod_rewrite) to pass something as reverse proxy to another apache instance.
So I've got url like this:
/index.php/info?format=xml&token=SOMENUMERICTOKEN&token=SUMENUMERICTOKEN
I've tried :
PassProxy /index.php/info?format=xml https://1.2.3.4:567/index.php/info?format=xml
and relevant ProxyReverse but it's not working
Also tried Rewrite with same lines and [P] ending for proxying.
Non of them work.
They would work if i end with /index.php but I cannot allow access to index.php
-
Krist van Besien about 10 yearsProxyPass only operates on the URL. So you should ignore the query string. The query string will just be passed on. If you need to manipulate the query string as well you'll need a ReWriteRule.
-
Admin about 2 yearsIs this a question in an answer?