How to proxy_pass POST with headers

Valentin V. Bartenev ne at vbart.ru
Sat Jan 28 09:59:39 UTC 2012


On Saturday 28 January 2012 01:27:29 Max wrote:
[...]
> location ~ ^/post_redirect/(.*)$ {
>   internal;
>   proxy_set_header Host $http_host;
>   set $proxy_url http://foo.bar:8085/$1;
>   if ($args) {
>     set $proxy_url http://foo.bar:8085/$1?$args;
>   }
>   proxy_pass $proxy_url;
> }
[...]

  proxy_pass http://foo.bar:8085/$1$is_args$args;

 but, actually, this would be better:

  location /post_redirect/ {
      internal;
      proxy_pass http://foo.bar:8085/;
      proxy_redirect off;
  }

 wbr, Valentin V. Bartenev



More information about the nginx mailing list