1. .Net Core Project. Appsettings.json I added these 2 sections. "Kestrel": { "Endpoints": { "Http": { "Url": "http://localhost:60110" }, "Https": { "Url": "https://localhost:60111" } } }, "https_port": 60111 2. Program.cs public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>() .UseUrls(@"http://*:60110") .UseUrls(@"https://*:60111") .UseKestrel(); }); 3. Startup.cs I added app.UseHsts(); 4. Nginx I have 2 vhost files. 1 is for my ‘listen 80;" which works. My 2nd is this : server { listen 443 ssl; ssl_certificate /path/to/fullchain.pem #managed by Certbot ssl_certificate_key /path/to/privkey.pem #managed by Certbot root /var/www/websiteFolder; server_name MyDomain.tech location / { proxy_pass https://localhost:60111; 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;} }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)