0

trying to redirect all non-www traffic to www and all http traffic to https.

Environment is Magento 1.9 with Varnish and nginx. We also have Cloudflare (fully SSL enabled). Using the code below in vhosts, it doesn't redirect correctly - anybody see anything wrong?

Many thanks

server {
  listen 80;
  server_name www.example.com example.com;
   return 301 https://www.example.com$request_uri;
}
server {
  server_name example.com;
  {{ssl_listener}};
  {{ssl_certificate}};
  {{ssl_certificate_key}};
  ssl_session_cache  builtin:1000  shared:SSL:10m;
  ssl_session_timeout  10m;
  ssl_protocols TLSv1.1 TLSv1.2;
  ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
  ssl_prefer_server_ciphers on;
  ssl_stapling on;
  ssl_stapling_verify on;
  return 301 https://www.example.com$request_uri;
}
2
  • You shouldn't use Magento 1.x with Turpentine's Varnish implementation unless you accept a bunch of security issues (disable CSRF), else every first-page visit will be uncached. See here. Apr 20, 2020 at 20:59
  • Thanks for the update. Decided we're going to disable Varnish
    – RHNC
    Apr 21, 2020 at 15:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.