all request is redirected to one port if there is multiple listen in default server section
Delta Yeh
delta.yeh at gmail.com
Fri Apr 10 10:50:19 MSD 2009
thanks for you quick fix.
2009/4/10 Igor Sysoev <is at rambler-co.ru>
> On Fri, Apr 10, 2009 at 10:24:59AM +0800, Delta Yeh wrote:
>
> > I use the following config:
> >
> > server {
> > listen 192.168.1.102:80;
> > listen 192.168.1.102:81;
> >
> > server_name _; #default
> > return 444;
> > }
> >
> > #upstream cfg
> > upstream web_upstream0 {
> > server 192.168.39.100:81 max_fails=3 fail_timeout=30s;
> >
> > }
> > upstream web_upstream1 {
> > server 192.168.39.100 max_fails=3 fail_timeout=30s;
> >
> > }
> >
> > server {
> > listen 192.168.1.102:81;
> > server_name www.test1.com;
> > location / {
> >
> > proxy_pass http://web_upstream0/;
> > }
> > }
> > server {
> > listen 192.168.1.102:80;
> > server_name www.test2.com;
> > location / {
> >
> > proxy_pass http://web_upstream1/;
> > }
> > }
> >
> >
> > It seems all request to www.test1.com is passed to www.test2.com.
> >
> >
> > If I use:
> >
> > server {
> > listen 192.168.1.102:80;
> >
> > server_name _; #default
> > return 444;
> > }
> > server {
> > listen 192.168.1.102:81;
> >
> > server_name _; #default
> > return 444;
> > }
> >
> > instead, every thing is OK.
> > Is this a bug ?
>
> Yes, this is a bug, introduced in 0.7.39. The attached patch fixes it.
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090410/5fa9bcfb/attachment.html>
More information about the nginx
mailing list