server {
        listen {{ CS_FRONTEND_HTTP_PORT | last }};
        listen [::]:{{ CS_FRONTEND_HTTP_PORT | last }};
	include /etc/nginx/includes/ssl*conf;

	root /var/www/r7-office/forms;
	index index.html;
        server_name {{ CS_FRONTEND_PREFIX_FORMS | last }}.{{ CS_FRONTEND_DOMAIN | last }};
	server_tokens off;

	location /app/ {
	    proxy_pass http://{{ CS_API_HOST | last }}:8080/; 
	    proxy_set_header Host               $host;
	    proxy_set_header X-Real-IP          $remote_addr;
	    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
	    proxy_set_header X-Forwarded-Proto  $scheme;
	}

	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 Forms;
	    proxy_pass http://{{ CS_API_HOST | last }}:{{ CS_API_PORT | last }}/api;
	}

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

#	location /source {
#	    proxy_pass https://{{ CS_FRONTEND_SCHEME | last }}://{{ CS_FRONTEND_PREFIX_CDDISK | last }}.{{ CS_FRONTEND_DOMAIN | last }}/source;
#	}

}
