worker_processes  1;

events {
    worker_connections  1024;
}

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

    sendfile        on;
    keepalive_timeout  65;
	
	access_log  off;
    error_log off;

    server {
        listen       80;
        server_name  localhost;

	# Proxy to DPT-Web IDE server
        location /webide {
            proxy_pass  http://127.0.0.1:10000/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }

	# Proxy to userspace program, ready for BlueCherry
	location /user {
	    proxy_pass http://127.0.0.1:8080/;
	    # Workaround for newer safari browsers 
	    keepalive_timeout 0;			
	}

	# Proxy to the breakout server api
        location /api {
            proxy_pass http://127.0.0.1:9999;
	    # Workaround for newer safari browsers
	    keepalive_timeout 0;
        }
	
	# Static file host
        location / {
            root /www;
        }

        # redirect server error pages to the static page /50x.html
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

