Good progress but different server. ONE PROBLEM REMAINS
I managed to get NGINX working on a different Windows server 2008 R2. This server is very similar to the other one but works with Tim's config. (I will return to the other server later.)
The only problem I now have is there are two domains (actually sub-domains) and they run different Stand Alone Xojo apps on different ports. NGINX is handling the certs up front and they are proxied to different ports like this : 127.0.0.1:<port>. It works fine if I go directly to the HTTPS URL.
I wanted to have NGINX do an HTTP 301 and force HTTP to HTTPS.
Here is the NGINX to redirect to the HTTPS site from HTTP:
#This forces http to https
server_name <sub-domain-1>.sbswebapp.com <sub-domain-2>.sbswebapp.com;
return 301 https://$server_name$request_uri;
This redirect does work but it always ends up at the same sub-domain no matter which sub-domain is used in the URL in the browser.
I would have thought that the RETURN 301 line with the parameters would do the correct redirect.
It seems to be possibly browser cache related. If I clear the cache then it always goes to the first sub-domain I use after clearing no matter which one I specify in the URL.
I have these in the NGINX config (in the location section) but it does not help:
My temporary work around is simply deny HTTP (no S).
Any thoughts on an HTTP 301 redirect would be appreciated.