If you don't want to deal with code changes and still want free cloudflare flexible cert to work in any nopcommerce version, you can add page rules in CF to always use https and add outbound rule below:
This will work without check in store configuration to useSSL and without forceSSL setting.
you are a superstar! although I would change your comment to say:
create the "always use https" page rule in cloudflare and add the following to your existing web.config file in the <system.webServer> section, for example:
Actually, the above doesn't work properly... It screws up the one page checkout and when continuing from entering the billing address, takes you back to the checkout page :-(
Actually, the above doesn't work properly... It screws up the one page checkout and when continuing from entering the billing address, takes you back to the checkout page :-(
Found a workaround for this, just need to change the ~\Theme\Views\Checkout\OnePageCheckout.cshtml Change (nopcommerce 4.x): var storeLocation = webHelper.GetStoreLocation(); to: var storeLocation = webHelper.GetStoreLocation(true);
For those who are still struggling with Cloudflare Flexible SSL, this is how we solved the issue in nop 4.20: 1. Set UseHttpXForwardedProto = true in Nop.Web/appsettings.json (Cloudflare setups X-Forwarded-Proto header to determine if request is secured. See more https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers- ). 2. Ensure "Always Use HTTPS" setting is enabled in Cloudflare. 3. Ensure nopCommerce Store "URL" has https schema. 4. Ensure nopCommerce Store "SSL Enabled" setting is set to true. 5. Ensure nopCommerce "Force SSL for all pages" is enabled.
Thanks ellasoftware, I can confirm it works with nopCommerce 3.9 too. Need to enable (Web.config): <add key="Use_HTTP_X_FORWARDED_PROTO" value="true" />
Actually, the above doesn't work properly... It screws up the one page checkout and when continuing from entering the billing address, takes you back to the checkout page :-(
Found a workaround for this, just need to change the ~\Theme\Views\Checkout\OnePageCheckout.cshtml Change (nopcommerce 4.x): var storeLocation = webHelper.GetStoreLocation(); to: var storeLocation = webHelper.GetStoreLocation(true);
I am unable to find this in nopCommerce 4.20 - Can I find it somewhere else?
For those who are still struggling with Cloudflare Flexible SSL, this is how we solved the issue in nop 4.20: 1. Set UseHttpXForwardedProto = true in Nop.Web/appsettings.json (Cloudflare setups X-Forwarded-Proto header to determine if request is secured. See more https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers- ). 2. Ensure "Always Use HTTPS" setting is enabled in Cloudflare. 3. Ensure nopCommerce Store "URL" has https schema. 4. Ensure nopCommerce Store "SSL Enabled" setting is set to true. 5. Ensure nopCommerce "Force SSL for all pages" is enabled.
Hi,
This doesn't seem to work for me.. I'm using nopCommerce 4.20 and I followed all of these steps but end up having a redirect loop as soon as I check the "SSL Enabled" box.
For those who are still struggling with Cloudflare Flexible SSL, this is how we solved the issue in nop 4.20: 1. Set UseHttpXForwardedProto = true in Nop.Web/appsettings.json (Cloudflare setups X-Forwarded-Proto header to determine if request is secured. See more https://support.cloudflare.com/hc/en-us/articles/200170986-How-does-Cloudflare-handle-HTTP-Request-headers- ). 2. Ensure "Always Use HTTPS" setting is enabled in Cloudflare. 3. Ensure nopCommerce Store "URL" has https schema. 4. Ensure nopCommerce Store "SSL Enabled" setting is set to true. 5. Ensure nopCommerce "Force SSL for all pages" is enabled.
Thank you so much.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.