Webassembly Blazor project hosted on digitalocean forces HTTPs


I use default project sample ( “blazor-wasm”) and I need to support both HTTP & HTTPs protocols. I have removed execution of app.UseHsts() and app.UseHttpsRedirection() from the AppHost/Program but still when I try to access the domain with HTTP protocol I am redirected to HTTPs. Is it something related to letsencrypt service?

On get request there is “307 Internal Redirect” with (https) Location: https://somedomain.com/
and “Non-Authoritative-Reason:HSTS”

Hi @diskman, how are you hosting your application? Is it using the nginx-proxy container setup with docker compose or something else?

If you are using the nginx-proxy docker setup, you can include the environment variable HTTPS_METHOD=noredirect to disable the default HTTPS redirect.

See the GitHub README for the project for more options and details on configuring the nginx-proxy.

1 Like

Thanks for the help. I have updated the nginx-proxy-compose.yml and added both env variables - all works now correctly!

HTTPS_METHOD: "noredirect"
HSTS: "off"
1 Like