proxy_pass destination set by request custom header

masterkain nginx-forum at
Thu Jun 21 17:06:42 UTC 2012


  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;

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


Posted at Nginx Forum:,227781,227781#msg-227781

More information about the nginx mailing list