I’m currently working on a Progressive Web App(PWA) using ASP.NET Core. After creating our initial setup I used the Google Lighthouse chrome extension to check my application.
The results looked OK, I only had one failed audit: “Does not redirect HTTP traffic to HTTPS”.
Let’s fix this by adding the AspNetCore Rewrite middleware:
If you need to specify a port, you can add some extra parameters: