Welcome! Log In Create A New Profile

Advanced

Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

Styopa Semenukha
October 06, 2014 10:22PM
On Monday, October 06, 2014 12:24:35 PM mottycruz wrote:
> Thanks for your help Styopa,
>
> I was able to find modules installed on our current proxy with the following
> command, because we have a customize module.
>
> :~# /usr/local/nginx/sbin/nginx -V
> nginx version: nginx/0.7.67
> built by gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
> TLS SNI support enabled
> configure arguments: --prefix=/usr/local/nginx --with-http_ssl_module
> --add-module=/home/ngx_http_cust_app_version_routing
>
> I tried to redirect base on URL
>
> for instance I tried:
> Redirect ^/app2$ http://app2.server2.com;
>
> but does not seem to be working, I can't find much in the logs. do you have
> any suggestions?
>
> Thanks,
> -Motty
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,253708,253792#msg-253792
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx

Hello Motty,

I'm a little bit confused by your question. If your goal is to serve different URLs by different backends, the config will look like this:

location = /app2 {
# this will strip "/app2" from the request to the backend
# e.g. user request of: /app2/index.do?foo=bar
# will be routed to app2 backend as:
# /index.do?foo=bar
proxy_pass http://app2.server2.com/;
}

If your goal is to return HTTP 301 permanent redirect, it will be:
location = /app2 {
return 301 $scheme://app2.server2.com/;
}

Please be sure to read the following info (it's pretty short actually):
http://nginx.org/r/location
http://nginx.org/r/proxy_pass

Unfortunately, I'm not familiar with 3rd-party modules, so I cannot advise on them.
--
Sincerely yours,
Styopa Semenukha.

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

Nginx 1.6.2 - Redirect users base on 4 digits number provide

mottycruz October 02, 2014 10:51AM

Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

Styopa Semenukha October 02, 2014 11:12AM

Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

mottycruz October 02, 2014 12:14PM

Re: Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

Styopa Semenukha October 02, 2014 01:48PM

Re: Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

mottycruz October 03, 2014 12:33PM

Re: Re: Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

Styopa Semenukha October 03, 2014 03:32PM

Re: Re: Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

mottycruz October 06, 2014 12:24PM

Re: Nginx 1.6.2 - Redirect users base on 4 digits number provide

Styopa Semenukha October 06, 2014 10:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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