Answers for "if ($host ~* ^www\.(.*)$) { rewrite / $scheme://$1 permanent; }"

0

if ($host ~* ^www\.(.*)$) { rewrite / $scheme://$1 permanent; }

if ($host ~* www\.(.*)) {
  set $host_without_www $1;
  rewrite ^(.*)$ http://$host_without_www$1 permanent; # $1 contains '/foo', not 'www.mydomain.com/foo'
}
Posted by: Guest on April-06-2021

Browse Popular Code Answers by Language