Apache Location Reverseproxy URL not working
up vote
0
down vote
favorite
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
add a comment |
up vote
0
down vote
favorite
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
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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
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
regex apache reverse-proxy mod-proxy
asked Nov 12 at 5:53
Jaskaran Singh Puri
192316
192316
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
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.
add a comment |
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',
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%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
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
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.
add a comment |
up vote
0
down vote
up vote
0
down vote
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.
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.
answered Nov 12 at 9:06
Mark Otting
26915
26915
add a comment |
add a comment |
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.
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%2fstackoverflow.com%2fquestions%2f53256545%2fapache-location-reverseproxy-url-not-working%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