Welcome! Log In Create A New Profile

Advanced

Re: Could Nginx redirected proxied traffic?

Valentin V. Bartenev
September 13, 2014 06:44AM
On Saturday 13 September 2014 17:29:57 Dewangga wrote:
> Hi,
>
> The original URI is :
>
> http://engine.xtremenitro.org:6800/jobs
> http://engine.xtremenitro.org:6800/logs
>
> .. etc
>
> And if proxied, should be:
> http://engine.xtremenitro.org/monitor/jobs
> http://engine.xtremenitro.org/monitor/logs
>
> .. etc
>
> I want to close the unusual port, and proxied to nginx. So I can
> control the logs only from nginx.
>
> Is it possible?
>

First of all, with your config:

location /monitor {
proxy_pass http://backend:6800/;
proxy_redirect default;
}

"/monitor" part of URI is replaced with "/",
so requesting "/monitor/logs/" results in a
request to "//logs/", and I'm not sure that
your backend is able to handle that.

Please, check the documentation:
http://nginx.org/r/proxy_pass

Probably, all you need is just this:

location /monitor/ {
proxy_pass http://backend:6800/;
}

wbr, Valentin V. Bartenev

> On 09/13/2014 05:29 PM, Valentin V. Bartenev wrote:
> > On Saturday 13 September 2014 16:46:56 Dewangga wrote:
> >> Hi,
> >>
> >> I have configuration like this :
> >>
> >> ... snip ... location /monitor { proxy_pass
> >> http://backend:6800/; proxy_redirect default; } ... snip ...
> >>
> >> Trying to access /monitor, it's works. But, I tried to access
> >> URL behind them, /monitor/logs/, /monitor/jobs/ it's error 404,
> >> the log said :
> >>
> >> ip.ad.dr.es - - [13/Sep/2014:16:42:35 +0700] "GET /logs/
> >> HTTP/1.1" 404 599 "http://engine.xtremenitro.org/monitor"
> >> "Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101
> >> Firefox/31.0" ip.ad.dr.es - - [13/Sep/2014:16:45:24 +0700] "GET
> >> /jobs HTTP/1.1" 404 599 "http://engine.xtremenitro.org/monitor"
> >> "Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101
> >> Firefox/31.0"
> >>
> >> But, if I try to access them directly through port 6800 (traffic
> >> not proxied from nginx), everything works. I assume, that
> >> actually the backend support rewrite URL, but while proxied, the
> >> rewrite URL didn't works.
> >>
> >> Any hints?
> >>
> >
> > When you access it directly, what URI do you use?
> >
> > wbr, Valentin V. Bartenev
> >
> > _______________________________________________ nginx mailing list
> > nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
> >
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Could Nginx redirected proxied traffic?

dewanggaba September 13, 2014 05:50AM

Re: Could Nginx redirected proxied traffic?

Valentin V. Bartenev September 13, 2014 06:30AM

Re: Could Nginx redirected proxied traffic?

dewanggaba September 13, 2014 06:34AM

Re: Could Nginx redirected proxied traffic?

Valentin V. Bartenev September 13, 2014 06:44AM

Re: Could Nginx redirected proxied traffic?

dewanggaba September 13, 2014 06:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 140
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