Welcome! Log In Create A New Profile

Advanced

Is there any way to redirect request to another server conf?

Thomas
June 12, 2012 07:30AM
Hi All,

I'm trying to use nginx as a proxy server which can judge server name
by url.

e.g.

server {
listen 80 default_server;
my_rewrite_directive;
}

server {
server_name a.com;
root html/a;
}

server {
server_name b.com;
root html/b;
}

then GET /a.com/index.html will be redirected to server a.com;

I tried to write a module to accomplish this by modifying members in http
request structure, but it seems that r->srv_conf has already been set
before running module phases. I tried internal redirect and it didn't help.
so my question is,

Is there any way to redirect request to another server conf without
modifying the nginx core?

Thanks in advance.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Is there any way to redirect request to another server conf?

Thomas 973 June 12, 2012 07:30AM

Re: Is there any way to redirect request to another server conf?

António P. P. Almeida 476 June 12, 2012 07:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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