I'm on kestrel/nginx with asp.net core. I have some urls which don't need https redirect, that's why I have the following nginx conf
server {
listen *:80;
server_name example.com *.example.com;
location / {
add_header Strict-Transport-Security max-age=15768000;
return 301 https://example.com$request_uri;
}
location /DirectDownload/ {
proxy_pass http://example;
limit_req zone=one burst=10 nodelay;
}
}
In the Startup.cs I have
- UseHsts()
- NO UseHttpsRedirection()
Strangely enough, this has worked in the past. Unfortunately, the response header doesn't tell which part of my application triggers the 307 hsts redirect... Is there something obvious I'm missing?
This is the only :80 nginx conf.
Here's an example of the headers:
Thanks for your help!