﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
156	Virtualhost randomly displaying incorrect output	Ben Maynard	somebody	"I have a somewhat complex environment:

GTM frontend Redirects to
LTM redirects to
load balanced varnish with
6 nginx backends, serving about 80 virtual hosts using uwsgi to serve django sites.

The problem I have is randomly a site will display the page of a random virtualhost (there doesn't appear to be any consistency in which site it may display), additionally on occasion it will simply display a random image from a page rather than the full page.

My nginx.conf file is:

user              nginx;
worker_processes  2;
worker_rlimit_nofile 32768; 

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
   worker_connections  4096;
    use epoll;
}

http {
    include                       /etc/nginx/mime.types;
    default_type                  application/octet-stream;
    sendfile                      on;
	expires 					  -1; 
    server_tokens 				  off;     
    tcp_nopush                    on;
    tcp_nodelay	                  on;
    client_max_body_size          50m;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size    1024;
    keepalive_timeout			  65;
    types_hash_max_size 		  2048; 
    server_name_in_redirect 	  off

    gzip                          on;    
    gzip_types                    application/x-javascript application/javascript text/xml text/css text/plain;
    gzip_vary                     on;
    gzip_proxied                  any;
    gzip_disable                  ""MSIE [1-6] \."";

    log_format hostcombined '$server_name $remote_addr - $remote_user [$time_local]  ""$request"" $status $body_bytes_sent ""$http_referer"" ""$http_user_agent""';
    access_log                   /var/log/nginx/access.log hostcombined;
    error_log                    /var/log/nginx/error.log info;

    upstream uwsgi_upstream {
        server unix:/var/run/uwsgi/uwsgi.sock;     
    }

    # Load config files from the /etc/nginx/conf.d directory
    include                      /etc/nginx/conf.d/*.conf;
    include                      /etc/nginx/sites-enabled/*.conf;
}


My virtual hosts are stored in a domain per file and all are identical other than the paths, and server_names:

server {
    listen 80;
    server_name www2.example.com stage2.example.com origin-www2.example.com beta2.example.com;
    access_log /var/log/nginx/access_example.com_log main;
    root /srv/www/cms/clusters/mid_south/sites/example_com/site-media

	location /{
        uwsgi_pass uwsgi_upstream;
        include uwsgi_params;
        uwsgi_param UWSGI_SCRIPT deploy.mod_wsgi:WSGIHandler();
        uwsgi_param UWSGI_CHDIR /srv/www/cms/clusters/mid_south/sites/example_com;
        uwsgi_param UWSGI_SETENV DJANGO_SETTING_MODULE=settings;  
 	}

    location /site-media {
        alias /srv/www/cms/clusters/mid_south/sites/example_com/site-media;
        expires 2h;
    }
}


"	defect	closed	critical		nginx-core	1.0.x	worksforme			Linux mgi-ric-nebulaweb1.mgcorp.net 2.6.32-220.7.1.el6.x86_64 #1 SMP Fri Feb 10 15:22:22 EST 2012 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.0.15
built by gcc 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E"
