user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
events {	worker_connections 1024;    }

http {
	proxy_buffer_size   64k;
	proxy_buffers   4 64k;
	types_hash_max_size     4096;
	add_header X-Frame-Options sameorigin always;
    add_header X-Content-Type-Options nosniff;

	log_format  main  '[$time_local] $remote_addr VIA $scheme --- $status --- $request \n $ssl_client_fingerprint';
	access_log  /var/log/nginx/access.log  main;
	sendfile                on;
	tcp_nopush              on;
	include                 /etc/nginx/mime.types;
	default_type            application/octet-stream;

	server {
		listen              443 ssl;
		server_name         redos.ru-test.local;

		ssl_certificate     "/etc/ssl/private/SSL.crt";
		ssl_certificate_key "/etc/ssl/private/SSL.key";

		location /cm/oidc
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5000/cm/oidc; 	}
		location /cm/mc
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5001/cm/mc;	}
		location /cm/ss
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5002/cm/ss;	}
		location /cm/rss
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5003/cm/rss;	}
		location /cm/api
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5004/cm/api;	}
		location /cm/credprovapi
		{   include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5005/cm/credprovapi;	}
	}
	
	server {
		listen              3003 ssl;
		server_name         redos.ru-test.local;

		ssl_certificate     "/etc/ssl/private/SSL.crt";
		ssl_certificate_key "/etc/ssl/private/SSL.key";
		ssl_verify_client   optional_no_ca;
		
		location /agentregistrationapi 
		{ include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5006/agentregistrationapi;  }
		location /agentserviceapi      
		{ include /etc/nginx/conf.d/proxy.conf;   proxy_pass http://localhost:5007/agentserviceapi;
                                            proxy_set_header   x-ssl-client-cert $ssl_client_escaped_cert;  }
	}
}
