<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6002.16497" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#000000 size=2>Hello All -</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm having a very strange issue and maybe someone has experienced it or knows the solutions.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'll try to be brief. I have two clusters; we'll call them cluster 1 & 2.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>When I run the configuration everything appears to work.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But the strange this is that it will only work if I use the URL and not the IP. If i use the IP address it defaults to the other cluster...very strange...here's my config to get a better picture.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>user www-data;<BR>worker_processes 2;</FONT></DIV>
<DIV><FONT face=Arial size=2># pid of nginx master process<BR>pid /var/run/nginx.pid;</FONT></DIV>
<DIV><FONT face=Arial size=2># uknown directive<BR>#worker_rlimit_nofile 8192;</FONT></DIV>
<DIV><FONT face=Arial size=2>events {<BR> worker_connections 4096;<BR> # use epoll;<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2>http {<BR> # Allow long server names<BR> server_names_hash_bucket_size 128; <BR> include /etc/nginx/mime.types;<BR> default_type application/octet-stream;<BR> <BR> log_format main '$remote_addr - $remote_user [$time_local] $status '<BR> '"$request" $body_bytes_sent "$http_referer" '<BR> '"$http_user_agent" "$http_x_forwarded_for"';<BR> # main log files<BR> access_log /var/log/nginx/access.log main;<BR> error_log /var/log/nginx_error.log debug;</FONT></DIV>
<DIV><FONT face=Arial size=2> # spool uploads to disk instead of clobbering downstream servers<BR> # client_body_temp_path /var/spool/nginx-client-body 1 2;<BR> # client_max_body_size 32m;<BR> # client_body_buffer_size 128k;<BR> <BR> server_tokens off;</FONT></DIV>
<DIV><FONT face=Arial size=2> keepalive_timeout 5;</FONT></DIV><FONT face=Arial size=2>
<DIV><BR> <BR> # no sendfile on OSX<BR> sendfile on;</DIV>
<DIV> # Optimized default values<BR> tcp_nopush on;<BR> tcp_nodelay off;<BR> </DIV>
<DIV> # compression saves bandwidth<BR> gzip on;<BR> gzip_http_version 1.0;<BR> gzip_comp_level 2;<BR> gzip_proxied any;<BR> gzip_min_length 1100;<BR> gzip_buffers 16 8k;<BR> gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;<BR> gzip_disable "MSIE [1-6].(?!.*SV1)";<BR> gzip_vary on;</DIV>
<DIV> # proxy settings<BR> proxy_redirect off;</DIV>
<DIV> proxy_set_header Host $host;<BR> proxy_set_header X-Real-IP $remote_addr;<BR> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<BR> proxy_max_temp_file_size 0;</DIV>
<DIV> proxy_connect_timeout 90;<BR> proxy_send_timeout 90;<BR> proxy_read_timeout 90;</DIV>
<DIV> proxy_buffer_size 4k;<BR> proxy_buffers 4 32k;<BR> proxy_busy_buffers_size 64k;<BR> proxy_temp_file_write_size 64k;</DIV>
<DIV> </DIV>
<DIV> upstream cluster1 {<BR> ip_hash;<BR> server 10.100.50.72:80;<BR> server 10.100.50.78:80;<BR> }<BR> include /etc/nginx/cluster1/cluster1.conf;</DIV>
<DIV> </DIV>
<DIV> upstream cluster2 {<BR> ip_hash;<BR> server 10.100.50.73:80;<BR> server 10.100.50.79:80;<BR> }<BR> include /etc/nginx/cluster2/cluster2.conf;</DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Here are my two includes:</DIV>
<DIV> </DIV>
<DIV>server {<BR> listen 80;<BR> server_name 10.100.50.13 cluster1.nowhere.net;<BR> access_log /var/log/nginx/cluster1.access.log main;<BR> location / {<BR> proxy_pass <A href="http://cluster1">http://cluster1</A>;<BR> proxy_set_header Host $host;<BR> proxy_set_header X-Real-IP $remote_addr;<BR> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<BR> }<BR> error_page 500 502 503 504 /50x.html;<BR> location = /50x.html {<BR> root /var/www/nginx-default;<BR> }<BR> }</DIV>
<DIV> </DIV>
<DIV>server {<BR> listen 80;<BR> server_name 10.100.50.14 cluster2.nowhere.net;<BR> access_log /var/log/nginx/cluster2.access.log main;<BR> location / {<BR> proxy_pass <A href="http://cluster2">http://cluster2</A>;<BR> proxy_set_header Host $host;<BR> proxy_set_header X-Real-IP $remote_addr;<BR> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<BR> }<BR> error_page 500 502 503 504 /50x.html;<BR> location = /50x.html {<BR> root /var/www/nginx-default;<BR> }<BR> }</DIV>
<DIV> </DIV>
<DIV>So in the 'include' files you'll notice i have the URL's. If keep the URL's in the configuration everythign works fine.</DIV>
<DIV>However if I just want to use the IP it defaults to the first conf file</DIV>
<DIV> </DIV>
<DIV>Example: server_name 10.100.50.14; </DIV>
<DIV> </DIV>
<DIV>Will always mysteriously just default to 10.100.50.13... </DIV>
<DIV> </DIV>
<DIV>Any help would be appreciated.</DIV>
<DIV> </DIV>
<DIV>-Shamunda</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV></FONT> </DIV><!--[object_id=#playlan.com#]--><P align=left><FONT face=Tahoma size=2><FONT color=#0000ff>***** Email confidentiality notice *****</P>
<P align=left><FONT face=Tahoma size=2><FONT color=#0000ff>26/1/2009</FONT></FONT></P>
<P align=left><FONT face=Tahoma size=2><FONT color=#0000ff>This message is private and confidential. If you have recieved this message in error, please notify us and remove it from your system.</FONT></FONT></P></FONT></FONT></BODY></HTML>