Welcome! Log In Create A New Profile

Advanced

proxy_pass destination set by request custom header

June 21, 2012 01:06PM
Hello,

location ~ ^/api/v(\d)/foo/bar/(.*) {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_max_temp_file_size 0;
proxy_pass http://$http_x_destination_host:$http_x_destination_port/$uri;
}

What I'm looking for is to have X-Destination-Host and X-Destination-Port contaning the exact host where to proxy_pass.
Since currently it doesn't seem to get picked up I would like to ask if is this appear correct (not counting security implications).

Thanks.
Subject Author Posted

proxy_pass destination set by request custom header

masterkain June 21, 2012 01:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready