limit_zone   tor  $binary_remote_addr  10m;

server {
#	limit_conn  tor  3;
	listen xx.yy.zz.243:80;
	# can't use wildcards in first server_name
	server_name testdomain.ru www.testdomain.ru;
	access_log  /dev/null;
	error_page  503			/templates/503.html;
	
        location /nginx_status {
            stub_status on;
            access_log   off;
            allow 127.0.0.1;
            allow xx.yy.zz.200;
            deny all;
	}	

	location / {
		# autoindex off;
		# autoindex_exact_size on;
		# autoindex_localtime off;

		# expires off;

		# cooperate with mod_realip in apache-1.3 or mod_rpaf in apache-2.x
		proxy_pass         http://127.0.0.1:80/;
		proxy_redirect off;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $remote_addr;
		#	proxy_pass http://back.end.addr.ess:80/;
		#
		# NB: it's better for URI canonicalization that apache sits on :80
		# (even if that's only 127.0.0.1:80)
		#
		# see also set_real_ip_from, real_ip_header if this nginx
		# would need to cooperate with another one acting as a frontend
	}

#        	charset         on;
#        	source_charset  koi8-r;

#  post script big limits set
location /files/  {
limit_conn tor  3;
}

# Static files location
                location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|html|iso|avi|mpg|mp3|mp4|mdf|mds)$ {
		root /var/www/vhosts/tor.theon.ru/www;
		}


}
