worker_processes  1;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 50m;
    client_body_buffer_size 50m;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m;
    fastcgi_connect_timeout 3m;
    fastcgi_send_timeout 3m;
    fastcgi_read_timeout 3m;
    proxy_connect_timeout 500;
    proxy_send_timeout 500;
    proxy_read_timeout 600;
    proxy_buffer_size 128k;
    proxy_buffers 256 128k;
    proxy_busy_buffers_size 128k;
    proxy_temp_file_write_size 128k;
    sendfile        on;
    keepalive_timeout  600;
    gzip on;
	gzip_min_length 0;
	gzip_buffers 4 16k;
	gzip_comp_level 4;
	gzip_proxied any;
	gzip_vary off;
	gzip_disable "MSIE [1-6]\.";
	gzip_static on;
	gzip_types
		application/atom+xml
        application/javascript
        application/json
        application/ld+json
        application/manifest+json
        application/rss+xml
        application/vnd.geo+json
        application/vnd.ms-fontobject
        application/x-font-ttf
        application/x-web-app-manifest+json
        application/xhtml+xml
        application/xml
        font/opentype
        image/bmp
        image/svg+xml
        image/x-icon
        text/cache-manifest
        text/css
        text/plain
        text/vcard
        text/vnd.rim.location.xloc
        text/vtt
        text/x-component
        application/octet-stream
        text/x-cross-domain-policy;



    server {
        listen       2181;
        server_name  111.230.84.223;
        location / {
			proxy_pass  http://172.31.255.107:2181;
        }
        location = /50x.html {
            root   html;
        }
    }
    server {
        listen       2182;
        server_name  111.230.84.223;
        location / {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

            proxy_set_header Cookie $http_cookie;
            proxy_cookie_domain domino_server nginx_server;
			proxy_pass  http://data.bailuntec.com;
        }
        location = /50x.html {
            root   html;
        }
    }


    server {
        listen       80;
        server_name  111.230.84.223;
        location /a{
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass  http://172.31.255.107:2181;
        }
        location = /50x.html {
            root   html;
        }
    }

    include servers/*;
}
