Requests going to the wrong upstream

Rainer Duffner rainer at
Tue Oct 13 22:34:08 MSD 2009


I have a configuration that has worked nicely in the past:

http {
        upstream appservers {
        #       ip_hash;
                server ip1:80 ;
#               server ip2:80 ;


   include       mime.types;
    default_type  application/octet-stream;

    keepalive_timeout  20;
    sendfile        on;
    tcp_nopush     on;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size 1024;

    gzip  on;
    gzip_comp_level  5;
    gzip_vary        off;
    gzip_proxied    any;
    gzip_types       text/plain text/css text/xml application/xml
text/javascript text/html application/x-javascript;

        include Includes/*.conf ;


The included files say something like:
    server {
        listen       80;
        include nginx-status.conf;
        include vhostnames-nginx-app.txt;

Two frontend nginx that connect to a corresponding backend apache each
(1:1 relationships, if you want).

However, I wanted to add other upstreams, for a different project:

        upstream other-project {
#                ip_hash;
                server other_ip1 ;
#                server other_ip2 ;

server {
        listen       80;
        server_name www.other-project ;

        access_log /export/home/logs/other-project/other-project-access.log;
/export/home/logs/other-project/other-project-stage-error.log ;
        location  /  {
                include proxy-lcb-lt.conf;
                proxy_pass  http://other-project;

But the proxy just forwards my request to the first "appserver" upstreams.
(Where the vhost doesn't exist and thus ends up at the default vhost)

Is that to be expected?

The IPs of the upstream are not in the same subnet, but connectivity is


More information about the nginx mailing list