# Default server configuration
#
server{
	listen 127.0.0.1:3080;
	return 404 "Please use https.";
}

server {

	listen 127.0.0.1:3443 default_server ssl;
	#listen 0.0.0.0:443 default_server ssl;

	client_max_body_size 3M;
	
	root /danfoss/user/html;

	index index.html index.htm;

	server_name _;

	include "/danfoss/nginx-auth-proxy/headers.conf";

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	location ~ \.cgi$ {
		  if ($request_method = 'OPTIONS') {
            return 204;
          }
          if ($request_method !~ ^(POST)$) {
            return 405;
          }
		  fastcgi_param REQUEST_METHOD $request_method;
          fastcgi_param QUERY_STRING $query_string;
          fastcgi_param REMOTE_ADDR $remote_addr;
          fastcgi_pass 127.0.0.1:9001;
        }
}
