memcached on the LB - please help this NEWB

vburshteyn nginx-forum at nginx.us
Fri Jun 19 23:52:19 MSD 2009


Hi folks,

So hopefully this will be very simple.

I got Nginx as a LB for the typical django setup.  I am trying to put memcached on the LB nginx and all i keep getting are 502 erros.



http {           
# main lb section to take the server out of rotation 
# then just comment out the server.
#


upstream www2.mywebsitecom {
#server 10.176.67.151:80; ### web1  
server 10.176.67.50:80;  ### web2
#server 10.176.75.7:80;  #### web3
}

upstream admin{
#server 10.176.67.151;
server 10.176.67.50;
#server 10.176.75.7:80;

}

server {
listen x.x.x.x:80;


location /admin {             #the following module scans for /admin and rerouts to it
proxy_pass http://admin;
include /etc/nginx/proxy.conf;
}


location / {
proxy_pass http://mywebsite.com;
include /etc/nginx/proxy.conf;

#set $memcached_key $uri;
#memcached_pass 127.0.0.1:11211;


}





}

  include       /etc/nginx/mime.types;
  default_type  application/octet-stream;
  access_log  /var/log/nginx/access.log;
  sendfile        on;
  #tcp_nopush     on;
  keepalive_timeout  999;
  tcp_nodelay        on;



#####################################
## Compression
  gzip              on;
  gzip_buffers      16 8k;
  gzip_comp_level   6;
  gzip_http_version 1.0;
  gzip_min_length   0;
  gzip_types        text/plain text/html text/css image/png image/gif image/jpg image/jpeg text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  gzip_vary         on;

#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3156,3156#msg-3156






More information about the nginx mailing list