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 năm cách đây
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 năm cách đây
Hi,

Just enable (uncomment) "Use_HTTP_X_FORWARDED_PROTO" element in web.config file
6 năm cách đây
Thanks Andrei,

I have another client on 3.5.
Was this feature supported prior to 3.9 or will an update be required?
6 năm cách đây
You can manually implement it in 3.50. Please see how this setting is used in 3.90
6 năm cách đây
Would you kindly point me at the relevant pages?
6 năm cách đây
Open the solution in Visual studio and search it by "Use_HTTP_X_FORWARDED_PROTO" keyword. You'll see all references
6 năm cách đây
@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 năm cách đây
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 năm cách đây
Thank you for the information.
5 năm cách đây
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.