nginx rule to capture header and append value as query string The Next CEO of Stack OverflowIn...
How to start emacs in "nothing" mode (`fundamental-mode`)
Is "for causing autism in X" grammatical?
Would a galaxy be visible from outside, but nearby?
Interfacing a button to MCU (and PC) with 50m long cable
Between two walls
How to solve a differential equation with a term to a power?
Multiple labels for a single equation
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
Non-deterministic sum of floats
Is it possible to search for a directory/file combination?
Why do we use the plural of movies in this phrase "We went to the movies last night."?
Are there any limitations on attacking while grappling?
If the heap is initialized for security, then why is the stack uninitialized?
Which tube will fit a -(700 x 25c) wheel?
Is it professional to write unrelated content in an almost-empty email?
Preparing Indesign booklet with .psd graphics for print
In excess I'm lethal
Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?
Why didn't Khan get resurrected in the Genesis Explosion?
Skipping indices in a product
If a black hole is created from light, can this black hole then move at speed of light?
Does it take more energy to get to Venus or to Mars?
Would a completely good Muggle be able to use a wand?
Return the Closest Prime Number
nginx rule to capture header and append value as query string
The Next CEO of Stack OverflowIn Nginx, block user based on X header valueNginx rewrite with query-string without ifNginx ignore query string for caching certain filesNginx no-cache header for ?random query stringNginx proxy_pass based on file extension and query stringSet Access-Control-Allow-Origin Header for specific URL that has a Query StringNginx Rewrite Rule Query String redirectRedirect respecting port in the host header?nginx rewrite if query string existsHow to redirect with query string in Nginx
I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of it and append that as a querystring parameter before doing a temporary redirect (rewrite) to a different (secure) server, while passing the paramater and any other querystring params along. This should be very doable, but how!?
Many thanks,
JS
nginx redirect http-headers querystring
add a comment |
I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of it and append that as a querystring parameter before doing a temporary redirect (rewrite) to a different (secure) server, while passing the paramater and any other querystring params along. This should be very doable, but how!?
Many thanks,
JS
nginx redirect http-headers querystring
add a comment |
I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of it and append that as a querystring parameter before doing a temporary redirect (rewrite) to a different (secure) server, while passing the paramater and any other querystring params along. This should be very doable, but how!?
Many thanks,
JS
nginx redirect http-headers querystring
I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of it and append that as a querystring parameter before doing a temporary redirect (rewrite) to a different (secure) server, while passing the paramater and any other querystring params along. This should be very doable, but how!?
Many thanks,
JS
nginx redirect http-headers querystring
nginx redirect http-headers querystring
asked Nov 16 '12 at 16:49
John SchulzeJohn Schulze
636
636
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
return https://example.com$uri?my_header=$http_my_header&$args;
If I understand you correctly.
- http://nginx.org/r/return
- http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
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%2f449497%2fnginx-rule-to-capture-header-and-append-value-as-query-string%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
return https://example.com$uri?my_header=$http_my_header&$args;
If I understand you correctly.
- http://nginx.org/r/return
- http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
add a comment |
return https://example.com$uri?my_header=$http_my_header&$args;
If I understand you correctly.
- http://nginx.org/r/return
- http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
add a comment |
return https://example.com$uri?my_header=$http_my_header&$args;
If I understand you correctly.
- http://nginx.org/r/return
- http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
return https://example.com$uri?my_header=$http_my_header&$args;
If I understand you correctly.
- http://nginx.org/r/return
- http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
edited 8 mins ago
superhawk610
1033
1033
answered Nov 16 '12 at 17:36
VBartVBart
6,76121724
6,76121724
add a comment |
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%2f449497%2fnginx-rule-to-capture-header-and-append-value-as-query-string%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