Apache Location Reverseproxy URL not working










0














I'm trying to match a URL with multiple params and use reverse proxy to load some other content, for some reason the Location Tag isn't working.



Following is my httpd.conf file



<Location "/tracker/">
ProxyPass "http://website.com:8290/track.js"
ProxyPassReverse "http://website.com:8290/track.js"
Order allow,deny
Allow from all
</Location>

<Location "/tracker/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)">
ProxyPass "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
ProxyPassReverse "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
Order allow,deny
Allow from all
</Location>


When I hit: https://website.com/tracker it works fine
But not with the other location, for eg If I hit:



https://website.com/tracker/csc-event?p=0%3Ajodv6q8w%3AdO9XGf6T4SCq7kz49hEEUwNvmkqR8Wxw&s=0%3Ajodv6q8w%3AHgkFFmKSZqdBB6E2C~F8xBKTHv8CGwbl&v=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_&e=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_0&c=jodvqubo&n=f&f=f&l=https%3A%2F%2Fwebsite.com%2F&i=11y&j=k8&k=1&w=mj&h=i9&t=pageView&x=-e1v043


It shows page not found error. What am I doing wrong? Is there some problem with regex or some other config problem?










share|improve this question


























    0














    I'm trying to match a URL with multiple params and use reverse proxy to load some other content, for some reason the Location Tag isn't working.



    Following is my httpd.conf file



    <Location "/tracker/">
    ProxyPass "http://website.com:8290/track.js"
    ProxyPassReverse "http://website.com:8290/track.js"
    Order allow,deny
    Allow from all
    </Location>

    <Location "/tracker/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)">
    ProxyPass "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
    ProxyPassReverse "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
    Order allow,deny
    Allow from all
    </Location>


    When I hit: https://website.com/tracker it works fine
    But not with the other location, for eg If I hit:



    https://website.com/tracker/csc-event?p=0%3Ajodv6q8w%3AdO9XGf6T4SCq7kz49hEEUwNvmkqR8Wxw&s=0%3Ajodv6q8w%3AHgkFFmKSZqdBB6E2C~F8xBKTHv8CGwbl&v=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_&e=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_0&c=jodvqubo&n=f&f=f&l=https%3A%2F%2Fwebsite.com%2F&i=11y&j=k8&k=1&w=mj&h=i9&t=pageView&x=-e1v043


    It shows page not found error. What am I doing wrong? Is there some problem with regex or some other config problem?










    share|improve this question
























      0












      0








      0







      I'm trying to match a URL with multiple params and use reverse proxy to load some other content, for some reason the Location Tag isn't working.



      Following is my httpd.conf file



      <Location "/tracker/">
      ProxyPass "http://website.com:8290/track.js"
      ProxyPassReverse "http://website.com:8290/track.js"
      Order allow,deny
      Allow from all
      </Location>

      <Location "/tracker/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)">
      ProxyPass "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
      ProxyPassReverse "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
      Order allow,deny
      Allow from all
      </Location>


      When I hit: https://website.com/tracker it works fine
      But not with the other location, for eg If I hit:



      https://website.com/tracker/csc-event?p=0%3Ajodv6q8w%3AdO9XGf6T4SCq7kz49hEEUwNvmkqR8Wxw&s=0%3Ajodv6q8w%3AHgkFFmKSZqdBB6E2C~F8xBKTHv8CGwbl&v=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_&e=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_0&c=jodvqubo&n=f&f=f&l=https%3A%2F%2Fwebsite.com%2F&i=11y&j=k8&k=1&w=mj&h=i9&t=pageView&x=-e1v043


      It shows page not found error. What am I doing wrong? Is there some problem with regex or some other config problem?










      share|improve this question













      I'm trying to match a URL with multiple params and use reverse proxy to load some other content, for some reason the Location Tag isn't working.



      Following is my httpd.conf file



      <Location "/tracker/">
      ProxyPass "http://website.com:8290/track.js"
      ProxyPassReverse "http://website.com:8290/track.js"
      Order allow,deny
      Allow from all
      </Location>

      <Location "/tracker/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)">
      ProxyPass "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
      ProxyPassReverse "http://website.com:8290/csc-event?p=([^s]+)&s=([^s]+)&v=([^s]+)&e=([^s]+)&c=([^s]+)&n=([^s]+)&f=([^s]+)&l=([^s]+)&i=([^s]+)&j=([^s]+)&k=([^s]+)&w=([^s]+)&h=([^s]+)&t=([^s]+)&x=([^s]+)"
      Order allow,deny
      Allow from all
      </Location>


      When I hit: https://website.com/tracker it works fine
      But not with the other location, for eg If I hit:



      https://website.com/tracker/csc-event?p=0%3Ajodv6q8w%3AdO9XGf6T4SCq7kz49hEEUwNvmkqR8Wxw&s=0%3Ajodv6q8w%3AHgkFFmKSZqdBB6E2C~F8xBKTHv8CGwbl&v=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_&e=0%3AJ1gADq10d3pj1JL1lh4Dd7ZlLxQyl2~_0&c=jodvqubo&n=f&f=f&l=https%3A%2F%2Fwebsite.com%2F&i=11y&j=k8&k=1&w=mj&h=i9&t=pageView&x=-e1v043


      It shows page not found error. What am I doing wrong? Is there some problem with regex or some other config problem?







      regex apache reverse-proxy mod-proxy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 '18 at 5:53









      Jaskaran Singh PuriJaskaran Singh Puri

      192316




      192316






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you want to use regex in a location directive you should add a tilde (~), but even then Location does not match the query string. Add /tracker/csc-event as a Location and check the query string inside that directive.



          Also, proxypass preverses the query string, no need to add it.






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            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%2fstackoverflow.com%2fquestions%2f53256545%2fapache-location-reverseproxy-url-not-working%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














            If you want to use regex in a location directive you should add a tilde (~), but even then Location does not match the query string. Add /tracker/csc-event as a Location and check the query string inside that directive.



            Also, proxypass preverses the query string, no need to add it.






            share|improve this answer

























              0














              If you want to use regex in a location directive you should add a tilde (~), but even then Location does not match the query string. Add /tracker/csc-event as a Location and check the query string inside that directive.



              Also, proxypass preverses the query string, no need to add it.






              share|improve this answer























                0












                0








                0






                If you want to use regex in a location directive you should add a tilde (~), but even then Location does not match the query string. Add /tracker/csc-event as a Location and check the query string inside that directive.



                Also, proxypass preverses the query string, no need to add it.






                share|improve this answer












                If you want to use regex in a location directive you should add a tilde (~), but even then Location does not match the query string. Add /tracker/csc-event as a Location and check the query string inside that directive.



                Also, proxypass preverses the query string, no need to add it.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 12 '18 at 9:06









                Mark OttingMark Otting

                28415




                28415



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


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





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2fstackoverflow.com%2fquestions%2f53256545%2fapache-location-reverseproxy-url-not-working%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

                    Darth Vader #20

                    How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

                    Ondo