nginx serve static files AND reverse proxy

Solution 1:

index mysite.html directive makes nginx server mysite.html to all requests that end with /.

If you want to only serve files from backend when a static file is not found, you need to have:

location / {
    # SERVE STATIC FILES:
    root C:blah/blah/blah;
    try_files $uri $uri/ @proxy;
}

location @proxy {
    # ANDDDD REVERSE PROXY TO BACKEND SERVERS:
    proxy_pass https://backend;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_read_timeout 86400;
}