ProxyPass|ProxyPassMatch can not have a path when defined in a location

15,499

Similarly as can be seen in the question you mention, there is a necessity to drop the first argument of the ProxyPass and ProxyPassReverse clauses when nested under <Location> clause.

So consider altering your config like this:

location1:

<Location /web/?_escaped_fragment_=/>
    ProxyPass /phpmyadmin !
    ProxyPass http://localhost:8082/          # <== Dropped '/'
    ProxyPassReverse http://localhost:8082/   # <== Dropped '/'
</Location>

location2:

<Location /web/#!/>
    ProxyPass /phpmyadmin !
    ProxyPass http://localhost:8080/          # <== Dropped '/'
    ProxyPassReverse http://localhost:8080/   # <== Dropped '/'
</Location>

This should work fine.

Share:
15,499
Chalaka Ellawala
Author by

Chalaka Ellawala

Updated on June 15, 2022

Comments

  • Chalaka Ellawala
    Chalaka Ellawala over 1 year

    I tried the answer in this problem. How to merge multiple ProxyPass directives in Apache? But I am getting an error when I am starting apache saying ProxyPass|ProxyPassMatch can not have a path when defined in a location.

    My 000-default.conf has below code

    <VirtualHost *:80>
    include location1.conf
    include location2.conf
    </VirtualHost>
    

    and my location1 has,

    <Location /web/?_escaped_fragment_=/>
    ProxyPass        /phpmyadmin !
    ProxyPass / http://localhost:8082/
    ProxyPassReverse / http://localhost:8082/
    </Location>
    

    and my location2 has,

    <Location /web/#!/>
    ProxyPass        /phpmyadmin !
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/
    </Location>