Re: proxy_pass with variable

2020-12-18 Thread Maxim Dounin
Hello! On Fri, Dec 18, 2020 at 06:37:57PM +, Jeffrey Knight wrote: > Hello ! > > I'm trying to get up a reverse proxy where my users can pass in a url of the > form > > https://my.server.com?https://some.other.server.com > > and it'll proxy to it. > > It works perfectly with this configu

proxy_pass with variable

2020-12-18 Thread Jeffrey Knight
Hello ! I'm trying to get up a reverse proxy where my users can pass in a url of the form https://my.server.com?https://some.other.server.com and it'll proxy to it. It works perfectly with this configuration with the proxy_pass target hard coded: ``` server { server_name my.server.com;

Re: proxy_pass with variable removes uri

2014-03-05 Thread Maxim Dounin
Hello! On Wed, Mar 05, 2014 at 07:46:38AM -0500, luckyswede wrote: > Cool, that works! > I don't understand why though, why is the uri urldecoded in my example but > not in your example? In your config, URI is defined using variables, and your are responsible for proper urlencoding. Config sug

Re: proxy_pass with variable removes uri

2014-03-05 Thread luckyswede
Cool, that works! I don't understand why though, why is the uri urldecoded in my example but not in your example? Also, I actually want the dns resolution to take place because I'm running in an AWS environment.. Thanks / Jonas Posted at Nginx Forum: http://forum.nginx.org/read.php?2,248124,24

Re: proxy_pass with variable removes uri

2014-03-05 Thread Francis Daly
On Wed, Mar 05, 2014 at 07:23:23AM -0500, luckyswede wrote: Hi there, > I've had troubles with url-decoding using this kind configuration, e.g. get > variables with values containing spaces have been decoded before proxied > which is resulting in an error. Untested, but I'd suggest to use a map

Re: proxy_pass with variable removes uri

2014-03-05 Thread Maxim Dounin
Hello! On Wed, Mar 05, 2014 at 07:23:23AM -0500, luckyswede wrote: > Hi, > I've had troubles with url-decoding using this kind configuration, e.g. get > variables with values containing spaces have been decoded before proxied > which is resulting in an error. > For example I've tried: > location

Re: proxy_pass with variable removes uri

2014-03-05 Thread luckyswede
Also, I want to make use of a resolver, which requires variables in the proxy_pass directive. Does this mean that it is not possible to automatically "strip" out the leading "/api" (which seems to not work with variables) and using resolvers (which requires variables)? BR / Jonas Posted at Nginx

Re: proxy_pass with variable removes uri

2014-03-05 Thread luckyswede
Hi, I've had troubles with url-decoding using this kind configuration, e.g. get variables with values containing spaces have been decoded before proxied which is resulting in an error. For example I've tried: location ~ ^/api/(.*) { proxy_pass http://api.$host/$1$is_args$args; } but that gives

Re: proxy_pass with variable removes uri

2014-03-05 Thread luckyswede
Thanks, But I want to automatically remove the "/api" part, just as it does if I don't use variables. So that isn't possible? BR / Jonas Posted at Nginx Forum: http://forum.nginx.org/read.php?2,248124,248128#msg-248128 ___ nginx mailing list nginx@ng

Re: proxy_pass with variable removes uri

2014-03-05 Thread Valentin V. Bartenev
On Wednesday 05 March 2014 05:47:58 luckyswede wrote: > Hi, > I have a conf with two virtual hosts and a proxy-pass that is dependent on > which host the request arrived to, like this: > > server { > listen 80; > server_name x.com y.com; > resolver 8.8.8.8; > ro

Re: proxy_pass with variable removes uri

2014-03-05 Thread Maxim Dounin
Hello! On Wed, Mar 05, 2014 at 05:47:58AM -0500, luckyswede wrote: > Hi, > I have a conf with two virtual hosts and a proxy-pass that is dependent on > which host the request arrived to, like this: > > server { > listen 80; > server_name x.com y.com; > resolver 8.8.8.

proxy_pass with variable removes uri

2014-03-05 Thread luckyswede
Hi, I have a conf with two virtual hosts and a proxy-pass that is dependent on which host the request arrived to, like this: server { listen 80; server_name x.com y.com; resolver 8.8.8.8; root /var/www/html; location / { # whatever }