upstream api-gateway {
    server <%= @ip %>:8080       weight=5;
}

upstream backendmonitor {
    server <%= @ip %>:22000      weight=5;
}

server {
    listen 443 ssl;
    server_name <%= @hostname %>;
    ssl_certificate /etc/nginx/ssl/<%= @hostname %>.crt;
    ssl_certificate_key /etc/nginx/ssl/<%= @hostname %>.key;

    location /  {
        proxy_pass http://api-gateway/api;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /events {
        proxy_pass  http://backendmonitor;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_set_header Connection '';
	    proxy_http_version 1.1;
	    proxy_read_timeout 3600s;
	    chunked_transfer_encoding off;
	    proxy_buffering off;
	    proxy_cache off;
	    error_page 504 =200 @eventsource-close-graceful;
    }

    location @eventsource-close-graceful {
        add_header Content-Type text/event-stream;
        return 200;
    }

}

upstream api-gateway {
    server <%= @ip %>:8080       weight=5;
}

upstream backendmonitor {
    server <%= @ip %>:22000      weight=5;
}

server {
    listen 443 ssl;
    server_name <%= @hostname %>;
    ssl_certificate /etc/nginx/ssl/<%= @hostname %>.crt;
    ssl_certificate_key /etc/nginx/ssl/<%= @hostname %>.key;

    location /  {
        proxy_pass http://api-gateway/;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location /events {
        proxy_pass  http://backendmonitor;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	    proxy_set_header Connection '';
	    proxy_http_version 1.1;
	    proxy_read_timeout 3600s;
	    chunked_transfer_encoding off;
	    proxy_buffering off;
	    proxy_cache off;
	    error_page 504 =200 @eventsource-close-graceful;
    }

    location @eventsource-close-graceful {
        add_header Content-Type text/event-stream;
        return 200;
    }

}

Fix path for the API
Fix path for the API
