我要在网站上添加.onion地址,并且需要将常规流量重定向到https和.onion流量,以保持为http。我有:
if ($scheme != "https") {
if ($host !~* "\.onion$") { # error occurs here
return 301 https://$host$request_uri;
}
}
我收到以下错误:
nginx: [emerg] "if" directive is not allowed here in nginx.conf:22