Closed jakubmaguza closed 2 years ago
in my opinion all those infrastructure settings should be transparent to the application. The application should be able to handle it. whether it is behind a load balancer or not. should be agnostic whether it runs in docker, vm, azure appservice, k8s, azure container apps or any other cloud infrasturcture
This property will set the header used to retrieve the value for the originating scheme (HTTP/HTTPS) If a proxy uses a different one. And we check it with string.IsNullOrEmpty
before use, so I don't think it matters. Now the UseProxy property has almost the same behaviour.
Closed #6238
Yes, you are checking it with string.IsNullOrEmpty
, but it defaults to empty string.
The problem is that empty string and null
for this property are totally different values.
So if you will use nginx as reverse proxy and enable ssl in config, you will not be able to access website, there will be a loop of redriects.
Setting this to null
or X-Forwarded-Proto
will fix that.
I'm writing this for future reference. I had exactly the same problem few months later.
Another thread with the same issue: https://www.nopcommerce.com/en/boards/topic/94036/ssl-enabled-causes-infinite-301/page/2
Another thread with the same issue: https://www.nopcommerce.com/en/boards/topic/94036/ssl-enabled-causes-infinite-301/page/2
I believe that this thread emphasizes setting "UseProxy" to "true". That resolves the problem with reverse proxies for the most of cases even if the other Hosting Options remain default.
I still a bit confused why dotnet doesn't listen to 5001 for https. But it is not important.
Hello, I belive
ForwardedProtoHeaderName
should be set to null orX-Forwarded-Proto
Setting it to empty string is confusing and creating a problem from this topic: https://www.nopcommerce.com/en/boards/topic/89707/problem-with-sslIt was easier to set it up with previous
appsetting.json
version, because it wastrue
orfalse
. This is now string property and if we want to use default option we should set it to null.