server {
        listen 80;
        listen [::]:80;
	listen 443 ssl; http2 on;

	if ($scheme != "https")
	{
		return 301 https://$host$request_uri;
	}

	root /var/www/r7-office/contacts;
	index index.html;

	server_name contacts.{domain};
	server_tokens off;

	ssl_protocols TLSv1.2 TLSv1.3;
	ssl_certificate /etc/nginx/ssl/{domain}.crt;
	ssl_certificate_key /etc/nginx/ssl/{domain}.key;
	ssl_ciphers HIGH:!aNULL:!MD5;

	location /api {
	    proxy_set_header host $host;
	    proxy_set_header X-real-ip $remote_addr;
	    proxy_set_header X-forward-for $proxy_add_x_forwarded_for;
	    proxy_set_header X-Module Contacts;
	    proxy_pass http://localhost:38033/api;
	}

        location / {
                try_files $uri $uri/ /index.html;
        }

	#location /source {
	#    proxy_pass http://cddisk.{domain}/source;
	#}

}
