I'm trying to do this in a nginx conf file but it doesn't work :
if ($scheme://$host = 'http://example.com') {
return 301 https://example.com$request_uri;
}
So how can I concatenate $scheme and $host in the if condition ?
It's easy with a temp variable
set $tmp $scheme://$host;
if ($tmp = 'http://example.com') {
return 301 https://example.com$request_uri;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With