user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;
    client_max_body_size 10M;
    #gzip  on;


   upstream easytimepro {
  	ip_hash;
  	server web:8000;
	}


   server {
  	location / {
        proxy_pass http://easytimepro;
        proxy_connect_timeout      3600;
        proxy_read_timeout         3600;
        proxy_send_timeout         3600;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_redirect off;
    	}
  	location /static {
        alias /app/mysite/static;
   	 }

  	location /media {
    	    alias /app/mysite/media;
    	}
  	location /iclock/file {
     	   alias /app/files;
    	}
  	location /files {
        	alias /app/files;
    	}
 
  	listen 8080;
	}

}
