Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Problem with ProxyPass |
|
Author |
|
notest77
Joined: 03 Mar 2023 Posts: 4 Location: PL
|
Posted: Thu 09 Mar '23 14:11 Post subject: Problem with ProxyPass |
|
|
I have two location directives with poxypass.
Code: | <LocationMatch "^/(generatedFiles|app|resources|node_modules|desktop|desktop-pl|desktop-en|build|main.js|app.js)/">
ProxyPass !
</LocationMatch> |
Code: | <LocationMatch "^/(.+)$">
ProxyPassMatch https://lab-plat-all-stack-win.web.lab/$1
</LocationMatch> |
After entering the first directive, the second directive is also processed
How do I make the second location directive not be processed after entering the first location directive? |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 348 Location: UK
|
Posted: Fri 10 Mar '23 19:19 Post subject: |
|
|
If you check the Apache documentation on how sections are evaluated / merged (https://httpd.apache.org/docs/current/sections.html#merging), you'll see the behaviour you're observing is to be expected. Basically the sections are merged sequentially, so your attempt to block proxying for certain URL paths does not carry from the first to second <Location> section.
Can I suggest you try reversing the logic, to proxy the entire site and then block the proxy for the content you want to serve locally, e.g.
Code: | <Location "/">
ProxyPass https://lab-plat-all-stack-win.web.lab/
</Location>
<LocationMatch "(?i)^/(generatedFiles|app|resources|node_modules|desktop|desktop-pl|desktop-en|build|main.js|app.js)">
ProxyPassMatch "!"
</LocationMatch>
|
|
|
Back to top |
|
|
|
|
|
|