##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just place in sites-disabled.
#
# You can move this to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

## Courseware (AP21) reverse-proxy server configuration
	location /crsw/ {
		## First, attempt to serve request as file, then as directory
#		try_files $uri $uri/ @proxy1;
#	}

#	# Proxy to upstream (backend) server
#	location @proxy1 {

		include /etc/nginx/proxy_params;

# The next three statements may be needed for IIS server connections
# and must come after the inclusion of proxy_params because of the 
# duplicate "connection" value:
#		proxy_set_header	Upgrade $http_upgrade;
#		proxy_set_header	Connection $connection_upgrade;
#		proxy_cache_bypass	$http_upgrade;

# Pass client certificate infomation to backend server.
		proxy_set_header	Verified $ssl_client_verify;
		proxy_set_header	SubjectDN $ssl_client_s_dn;

		proxy_pass		http://http_crsw_backend/crsw/;
		proxy_redirect		default;

		client_max_body_size       500m;
		client_body_buffer_size    128k;
		client_body_temp_path      /var/cache/nginx/client_temp 2;

		error_page 500 502 503 504 /50x.html;

		access_log  /var/log/nginx/crsw.proxy.access.log main;
		error_log  /var/log/nginx/crsw.proxy.error.log error;
	}
