server {
	listen 80 default_server;
	listen [::]:80 default_server;
	
	index index.html;
	
	location /fastweb/ {
		root /var/www;
		try_files $uri @index;
	}
 
	location /fastweb {
		alias /var/www/fastweb/;
	}
 
	location @index {
		root /var/www/fastweb;
		add_header Cache-Control no-cache;
		add_header Pragma no-cache;
		add_header Expires 0;
		try_files /index.html =404;
	}
	
	location /fastrest/signalr {
		proxy_pass http://localhost:5001/signalr;
		proxy_http_version 1.1;
 
		# Configuration for WebSockets
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "Upgrade";
		proxy_cache off;
		
		# Configuration for ServerSentEvents
		proxy_buffering off;
		
		# Configuration for LongPolling or if your KeepAliveInterval is longer than 60 seconds
		proxy_read_timeout 100s;
		
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
 
		proxy_cache_bypass $http_upgrade;
	}
 
	location /fastrest/ {
		proxy_pass http://localhost:5001/;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection keep-alive;
		proxy_set_header Host $host;
		proxy_cache_bypass $http_upgrade;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
	}
 
	location /fastmap/ {
		proxy_pass http://localhost:5002/;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection keep-alive;
		proxy_set_header Host $host;
		proxy_cache_bypass $http_upgrade;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Proto $scheme;
	}
}