upstream class_app_server {
        server 127.0.0.1:8001 fail_timeout=0;
}

#server {
#    server_name  cloudconference;
#    rewrite ^(.*) http://www.cloudconference.eu$1 permanent;
#}

server {
        listen 80;
        client_max_body_size 4G;
        server_name cloudscale.xlab.si

        keepalive_timeout 5;

        access_log  /var/log/nginx/distributedjmeter.access.log;
	error_log /var/log/nginx/distributedjmeter.error.log;

        root /var/www;

        location / {
		index index.html;
                gzip             on;
                gzip_min_length  1000;
                gzip_proxied     expired no-cache no-store private auth;
                gzip_types       text/plain text/xml text/css application/xhtml+xml application/xml application/rss+xml application/javascript application/x-javascript;
                gzip_disable     "MSIE [1-6]\.";
        }

	location ~ /showcase/ {
		include fastcgi_params;
		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		fastcgi_pass 127.0.0.1:9001;
		fastcgi_index index.php;
	}

	location /wiki {
		proxy_pass http://127.0.0.1:81;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	}
	
	location /distributed-jmeter/static {
		 alias /home/distributedjmeter/webapp/releases/current/webapp/static;
	}

        location /distributed-jmeter {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
		proxy_set_header SCRIPT_NAME /distributed-jmeter;
                proxy_redirect off;
                proxy_pass http://127.0.0.1:8001;
        }

	location /showcase-0 {
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
                proxy_redirect off;
                proxy_pass http://openstack.cloudscale.xlab.si/showcase-0;
	}
	location /showcase-1-a {
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
                proxy_redirect off;
                proxy_pass http://openstack.cloudscale.xlab.si/showcase-1-a;
	}
	location /showcase-1-b {
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
                proxy_redirect off;
                proxy_pass http://openstack.cloudscale.xlab.si/showcase-1-b;
	}
	location /jenkins {
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
                proxy_redirect off;
                proxy_pass http://localhost:8080;

	}
	location /sonar{
	        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header REMOTE_HOST $remote_addr;
                proxy_set_header X-FORWARDED-PROTOCOL $scheme;
                proxy_redirect off;
                proxy_pass http://localhost:9000;

	}

}
