ProxyPassMatch environment variable usage The 2019 Stack Overflow Developer Survey Results Are InIs it possible to get the matched regex from within the apache LocationMatch directive?Looking for equivalent of ProxyPassReverseMatch in Apache to fix missing trailing forward slash issueApache 2.4 + PHP-FPM + ProxyPassMatchDoes Apache's ProxyPassMatch trump rewrite rules?Restrict access dependent on environment variableProxyPassMatch not workingapache get environment variable valueApache 2.4: Set user dependent environment variableApache Custom Header with an environment variableProxyPassMatch matching for empty directory irrespective of regexUsing Environment variable in proxy_pass nginx
Right tool to dig six foot holes?
Button changing it's text & action. Good or terrible?
What is the closest word meaning "respect for time / mindful"
Can you compress metal and what would be the consequences?
Deal with toxic manager when you can't quit
How can I autofill dates in Excel excluding Sunday?
double encryption - One Time Pad
Identify This Plant (Flower)
FPGA - DIY Programming
Do these rules for Critical Successes and Critical Failures seem Fair?
Why did Acorn's A3000 have red function keys?
Protecting Dualbooting Windows from dangerous code (like rm -rf)
What are the motivations for publishing new editions of an existing textbook, beyond new discoveries in a field?
Why didn't the Event Horizon Telescope team mention Sagittarius A*?
How to notate time signature switching consistently every measure
Resizing object distorts it (Illustrator CC 2018)
How to answer pointed "are you quitting" questioning when I don't want them to suspect
What tool would a Roman-age civilization have for the breaking of silver and other metals into dust?
Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?
Is this app Icon Browser Safe/Legit?
What is the meaning of the verb "bear" in this context?
Does a dangling wire really electrocute me if I'm standing in water?
Write faster on AT24C32
Why can Shazam fly?
ProxyPassMatch environment variable usage
The 2019 Stack Overflow Developer Survey Results Are InIs it possible to get the matched regex from within the apache LocationMatch directive?Looking for equivalent of ProxyPassReverseMatch in Apache to fix missing trailing forward slash issueApache 2.4 + PHP-FPM + ProxyPassMatchDoes Apache's ProxyPassMatch trump rewrite rules?Restrict access dependent on environment variableProxyPassMatch not workingapache get environment variable valueApache 2.4: Set user dependent environment variableApache Custom Header with an environment variableProxyPassMatch matching for empty directory irrespective of regexUsing Environment variable in proxy_pass nginx
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Apache2.4
I am having difficulty figuring out how to use environment variable in ProxyPassMatch.
My general format:
<LocationMatch "(?<THING>Regex)">
ProxyPassMatch http://example.com:8000/%env:MATCH_THING
ProxyPassReverse /
</LocationMatch>
I have %MATCH_THINGe logged and the log shows that the Regex-Captured URL is capturing what I want it to capture, but every time I try to access the LocationMatched URL through the proxy, I get 404 Not Found.
It works when I directly try http://example.com:8000/RegexCapturedURL.
Where RegexCapturedURL = %MATCH_THINGe;
Here are some of the ProxyPassMatch's I have tried so far:
ProxyPassMatch http://example.com:8000/%env:MATCH_THINGProxyPassMatch http://example.com:8000/%MATCH_THINGProxyPassMatch http://example.com:8000/%THINGProxyPassMatch http://example.com:8000/%MATCH_THINGe
What am I doing wrong or not understanding correctly?
Any suggestions to improve this question are welcome.
apache-2.4 proxypass
add a comment |
Apache2.4
I am having difficulty figuring out how to use environment variable in ProxyPassMatch.
My general format:
<LocationMatch "(?<THING>Regex)">
ProxyPassMatch http://example.com:8000/%env:MATCH_THING
ProxyPassReverse /
</LocationMatch>
I have %MATCH_THINGe logged and the log shows that the Regex-Captured URL is capturing what I want it to capture, but every time I try to access the LocationMatched URL through the proxy, I get 404 Not Found.
It works when I directly try http://example.com:8000/RegexCapturedURL.
Where RegexCapturedURL = %MATCH_THINGe;
Here are some of the ProxyPassMatch's I have tried so far:
ProxyPassMatch http://example.com:8000/%env:MATCH_THINGProxyPassMatch http://example.com:8000/%MATCH_THINGProxyPassMatch http://example.com:8000/%THINGProxyPassMatch http://example.com:8000/%MATCH_THINGe
What am I doing wrong or not understanding correctly?
Any suggestions to improve this question are welcome.
apache-2.4 proxypass
add a comment |
Apache2.4
I am having difficulty figuring out how to use environment variable in ProxyPassMatch.
My general format:
<LocationMatch "(?<THING>Regex)">
ProxyPassMatch http://example.com:8000/%env:MATCH_THING
ProxyPassReverse /
</LocationMatch>
I have %MATCH_THINGe logged and the log shows that the Regex-Captured URL is capturing what I want it to capture, but every time I try to access the LocationMatched URL through the proxy, I get 404 Not Found.
It works when I directly try http://example.com:8000/RegexCapturedURL.
Where RegexCapturedURL = %MATCH_THINGe;
Here are some of the ProxyPassMatch's I have tried so far:
ProxyPassMatch http://example.com:8000/%env:MATCH_THINGProxyPassMatch http://example.com:8000/%MATCH_THINGProxyPassMatch http://example.com:8000/%THINGProxyPassMatch http://example.com:8000/%MATCH_THINGe
What am I doing wrong or not understanding correctly?
Any suggestions to improve this question are welcome.
apache-2.4 proxypass
Apache2.4
I am having difficulty figuring out how to use environment variable in ProxyPassMatch.
My general format:
<LocationMatch "(?<THING>Regex)">
ProxyPassMatch http://example.com:8000/%env:MATCH_THING
ProxyPassReverse /
</LocationMatch>
I have %MATCH_THINGe logged and the log shows that the Regex-Captured URL is capturing what I want it to capture, but every time I try to access the LocationMatched URL through the proxy, I get 404 Not Found.
It works when I directly try http://example.com:8000/RegexCapturedURL.
Where RegexCapturedURL = %MATCH_THINGe;
Here are some of the ProxyPassMatch's I have tried so far:
ProxyPassMatch http://example.com:8000/%env:MATCH_THINGProxyPassMatch http://example.com:8000/%MATCH_THINGProxyPassMatch http://example.com:8000/%THINGProxyPassMatch http://example.com:8000/%MATCH_THINGe
What am I doing wrong or not understanding correctly?
Any suggestions to improve this question are welcome.
apache-2.4 proxypass
apache-2.4 proxypass
edited May 4 '17 at 18:31
agent provocateur
asked Apr 14 '17 at 18:14
agent provocateuragent provocateur
13611
13611
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I Found this to be be very close to what you are looking.
https://stackoverflow.com/a/11852428/1459214
you can try the regex first to include more broad matching and then check to see if your regex is the issue, as given in the answer
main post is here: https://stackoverflow.com/questions/11852238/proxypassmatch-with-proxypassreverse
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f844571%2fproxypassmatch-environment-variable-usage%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I Found this to be be very close to what you are looking.
https://stackoverflow.com/a/11852428/1459214
you can try the regex first to include more broad matching and then check to see if your regex is the issue, as given in the answer
main post is here: https://stackoverflow.com/questions/11852238/proxypassmatch-with-proxypassreverse
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
add a comment |
I Found this to be be very close to what you are looking.
https://stackoverflow.com/a/11852428/1459214
you can try the regex first to include more broad matching and then check to see if your regex is the issue, as given in the answer
main post is here: https://stackoverflow.com/questions/11852238/proxypassmatch-with-proxypassreverse
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
add a comment |
I Found this to be be very close to what you are looking.
https://stackoverflow.com/a/11852428/1459214
you can try the regex first to include more broad matching and then check to see if your regex is the issue, as given in the answer
main post is here: https://stackoverflow.com/questions/11852238/proxypassmatch-with-proxypassreverse
I Found this to be be very close to what you are looking.
https://stackoverflow.com/a/11852428/1459214
you can try the regex first to include more broad matching and then check to see if your regex is the issue, as given in the answer
main post is here: https://stackoverflow.com/questions/11852238/proxypassmatch-with-proxypassreverse
edited May 23 '17 at 12:41
Community♦
1
1
answered Apr 14 '17 at 19:59
8080HouseFul8080HouseFul
11
11
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
add a comment |
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
i feel like i dont need to check my regex. as I mentioned, i am logging the regex matched portion and it shows exactly what I am trying to capture. do your references still apply? or do you think I have other issues that I am not understanding regarding the regex?
– agent provocateur
Apr 14 '17 at 20:01
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
additionally, this is associated with apache 2.4. i believe after 2.4.8 apache ignores numbered groups and only uses named grouping. I believe your reference utilizes numbered group. I think my issue is more of a problem with how to use environment variables in proxypassmatch than a problem with the regex. but I am happy to be corrected. (i have tried using a more broad matching regex before, but it doesnt really do anything in my case since my regex already captures the whole string when it should be captured)
– agent provocateur
Apr 14 '17 at 20:08
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
You have already said that if you use direct URL it works. and the only variable you are introducing is your Regex. I am not sure id your Regex is causing that isse , especially syntaxwise. So I am just suggesting another way to narrow down if your regex perhaps is the issue... The worst part here is there is no other way you can test your original URL+regex
– 8080HouseFul
Apr 14 '17 at 20:11
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
Ok Just saw your comment..
– 8080HouseFul
Apr 14 '17 at 20:13
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f844571%2fproxypassmatch-environment-variable-usage%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown