Why does this dynamic Nginx proxy configuration not work? -
i have nginx configuration looks this:
location /textproxy { proxy_pass http://$arg_url; proxy_connect_timeout 1s; proxy_redirect off; proxy_hide_header content-type; proxy_hide_header content-disposition; add_header content-type "text/plain"; proxy_set_header host $host; }
the idea proxies remote url, , rewrites content header text/plain.
for example call:
http://nx/textproxy?url=http://foo:50070/a/b/c?arg=abc:123
and return contents of http://foo:50070/a/b/c?arg=abc:123
, wrapped text/plain header.
this doesn't seem work though, 'invalid upstream port' errors:
2013/07/23 19:05:10 [error] 25292#0: *963177 invalid port in upstream "http://foo:50070/a/b/c?arg=abc:123", client: xx.xxx.xx.xx, server: ~^(?<h>nx)(\..+|)$, request: "get /textproxy?url=http://foo:50070/a/b/c?arg=abc:123 http/1.1", host: "nx"
any ideas? i'm having hard time trying work out.
Comments
Post a Comment