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;








0















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_THING


  • ProxyPassMatch http://example.com:8000/%MATCH_THING


  • ProxyPassMatch http://example.com:8000/%THING


  • ProxyPassMatch http://example.com:8000/%MATCH_THINGe

What am I doing wrong or not understanding correctly?



Any suggestions to improve this question are welcome.










share|improve this question






























    0















    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_THING


    • ProxyPassMatch http://example.com:8000/%MATCH_THING


    • ProxyPassMatch http://example.com:8000/%THING


    • ProxyPassMatch http://example.com:8000/%MATCH_THINGe

    What am I doing wrong or not understanding correctly?



    Any suggestions to improve this question are welcome.










    share|improve this question


























      0












      0








      0








      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_THING


      • ProxyPassMatch http://example.com:8000/%MATCH_THING


      • ProxyPassMatch http://example.com:8000/%THING


      • ProxyPassMatch http://example.com:8000/%MATCH_THINGe

      What am I doing wrong or not understanding correctly?



      Any suggestions to improve this question are welcome.










      share|improve this question
















      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_THING


      • ProxyPassMatch http://example.com:8000/%MATCH_THING


      • ProxyPassMatch http://example.com:8000/%THING


      • ProxyPassMatch 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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 4 '17 at 18:31







      agent provocateur

















      asked Apr 14 '17 at 18:14









      agent provocateuragent provocateur

      13611




      13611




















          1 Answer
          1






          active

          oldest

          votes


















          0














          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






          share|improve this answer

























          • 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











          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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






          share|improve this answer

























          • 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















          0














          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






          share|improve this answer

























          • 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













          0












          0








          0







          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






          share|improve this answer















          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







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

          Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos