SSL Configuration in Load balanced environment - Nopcommerce 3.9

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 anos atrás
Hi Andrei,

Is the "EnableSSL" flag supported in a load balanced environment in nop 3.9?

Currently "EnableSSL" causes redirection loop likely due to missing check for "X-Forwarded-Proto" header.

Manual redirect to https can be achieved instead using IIS Rewrite or example below:

  
protected void Application_BeginRequest() {
  if (!string.Equals(Request.Headers["X-Forwarded-Proto"], "https", StringComparison.InvariantCultureIgnoreCase) && HttpContext.Current.Request.IsLocal.Equals(false)) {
    Response.Redirect("https://" + Request.ServerVariables["HTTP_HOST"] + HttpContext.Current.Request.RawUrl);
  }
}


I am sure you are aware that doing the redirect manually will not not serve images from the database securely.

Is there ability in nopcommerce to serve the images via https in this setup?
6 anos atrás
Hi,

Just enable (uncomment) "Use_HTTP_X_FORWARDED_PROTO" element in web.config file
6 anos atrás
Thanks Andrei,

I have another client on 3.5.
Was this feature supported prior to 3.9 or will an update be required?
6 anos atrás
You can manually implement it in 3.50. Please see how this setting is used in 3.90
6 anos atrás
Would you kindly point me at the relevant pages?
6 anos atrás
Open the solution in Visual studio and search it by "Use_HTTP_X_FORWARDED_PROTO" keyword. You'll see all references
6 anos atrás
@AppSoft

I don't want to hijack your thread, but do have a question for you.  How are you setting up your load balancer?

Are you removing the incoming header from the client and replacing is with the X-Forwarded-Proto header and specifying https ?

I am trying to get my "ducks in a row" as well for SSL offloading.
6 anos atrás
Yes, I have the setup you descibed.

I then updated to nop 3.9 and enabled "Use_HTTP_X_FORWARDED_PROTO" in web.config.

Everything is now peachy!
6 anos atrás
Thank you for the information.
5 anos atrás
But seem like there is no such config in 4.0, and if i am using load balancer ssl offloading and enable ssl, it cause too many redirect error, can any one plz help
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.