server {
	listen 83;
    server_name www.fapi-resource.com;
    return 301 https://$host$request_uri; 
}

server {
    listen 443 ssl;
    ssl_certificate /etc/nginx/ssl/serverCA.crt;
    ssl_certificate_key /etc/nginx/ssl/serverCA.key;

    ssl_verify_client optional_no_ca;

	ssl_protocols TLSv1.2;
	ssl_ciphers 'DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
	ssl_prefer_server_ciphers on;

	location /resource {
        
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Prefix /;
        proxy_set_header X-Forwarded-Port 443;
	    proxy_set_header X-Forwarded-Ssl on;
        proxy_set_header X-SSL-CERT $ssl_client_escaped_cert;

        proxy_pass http://localhost:5002/resource;
    }
}
