Welcome! Log In Create A New Profile

Advanced

Re: rewrite and proxy_pass at the same time in nginx

November 18, 2013 09:29PM
I think I need something like this: http://stackoverflow.com/questions/18452676/dynamic-proxy-pass-with-map-and-regexp

but the difference is that in my case I need to split in 2 parts, the server name, "aserverthatlistens.com" ($some_url) and then the rest of the args: "serviceToCall" ($some_args) (which could be even longer). So then I think that I should do something like:

location ~ ^ xxxx {
resolver 8.8.8.8;
add_header Access-Control-Allow-Origin "*";
proxy_pass http://$some_url$some_args$args;
proxy_redirect off;
access_log on;
}

but the problem is how to get both parts and make the correct calles.... (xxxx part and proxy_pass call)

Thanks in advance,
Subject Author Posted

rewrite and proxy_pass at the same time in nginx

marianopeck November 18, 2013 03:55PM

Re: rewrite and proxy_pass at the same time in nginx

Francis Daly November 18, 2013 05:56PM

Re: rewrite and proxy_pass at the same time in nginx

marianopeck November 18, 2013 09:17PM

Re: rewrite and proxy_pass at the same time in nginx

marianopeck November 18, 2013 09:29PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 322
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready