1

I'm just trying to point my apache server at a node.js app by changing the virtual host settings to use proxy settings and when I try to make the Block match all locations via It matches only urls with 1 level deep url paths. /example works but /example/damn does not work. So I tried changing the regex to Which is even overkill but I thought I'd try it, I've been trying a lot of other regex combinations but none capture the URLs. I might add that this regex above actually doesn't capture anything AT ALL, it just shows the index list for my site when I got the url. The only regex that works at all is "/*" but it doesn't go deeper than 1 url /path/anotherpath

I checked that my regex should be matching everything at https://regex101.com/ But still apache isn't capturing it.

here's me config

<VirtualHost *:80>

        ServerName my.dev
        ServerAdmin [email protected]
        DocumentRoot /home/ggg/Dropbox/host-root/var/www/myleisure.com.au

        ProxyRequests Off
        ProxyPreserveHost On
        ProxyVia Full

        <Proxy "*">
                Require all granted
        </Proxy>

        <Location "(.*)*">
                ProxyPass http://localhost:3000
                ProxyPassReverse http://localhost:3000
        </Location>



</VirtualHost>

1 Answer 1

2

Here is quote from Apache directive configuration documentation page

The directive limits the scope of the enclosed directives by URL, in an identical manner to . However, it takes a regular expression as an argument instead of a simple string.

Therefore, try using:

<LocationMatch "(.*)*">
        ProxyPass http://localhost:3000
        ProxyPassReverse http://localhost:3000
</LocationMatch>
Sign up to request clarification or add additional context in comments.

1 Comment

</LocationMatch> But thank you so much. I'm still realising that I need to read documentation. But in my opinion I don't want to take the chance that I simply miss something or don't realise something in the documentation so I would rather see if someone has had the same problem. I'm guessing you just read the documentation though. It's a skill I need to work on. Thank you very much Nomad

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.