nginx rule to capture header and append value as query string

Posted by John Schulze on Server Fault See other posts from Server Fault or by John Schulze
Published on 2012-11-16T16:49:47Z Indexed on 2012/11/16 17:02 UTC
Read the original article Hit count: 264

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

© Server Fault or respective owner

Related posts about nginx

Related posts about redirect