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

server {
        listen 80;
        client_max_body_size 4G;
        server_name localhost

        keepalive_timeout 5;

        access_log  /path/to/webapp/logs/access.log;

        location /robots.txt {
            alias /path/to/webapp/static/robots.txt;
        }

        location /static/ {
                 alias /path/to/webapp/static/;

                 expires 30d;
                 access_log off;

                 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 / {
                 try_files $uri @proxy_to_app;

                 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-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://localhost:8080/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://localhost:8080/showcase-1-b;
	}

	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://localhost:8080/showcase-0;
	}


        location @proxy_to_app {
                 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://class_app_server;
        }
}
