B
B
Belkin2018-05-13 12:57:01
Nginx
Belkin, 2018-05-13 12:57:01

What is better to use to redirect to https on nginx for opencart?

What is better to use to redirect to https on nginx for opencart?

if ($scheme != "https") {
    rewrite ^ https://$host$uri permanent;
    }

or
location / {
                rewrite ^/(.*)$ https://$host/$1 permanent;
    }

Is there a difference and does it affect performance?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-05-13
@Belkin

Ceteris paribus, the variant without if is preferable, and in your case the second one also looks much more elegant.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question