Recently in nginx Category

nginx下获取部分主机名

| No Comments | No TrackBacks
server {
      listen          80;
      server_name     ^www.(?<domain>+)$;
      root            /var/www/htdocs/;
    if ($host ~* www\.(.*)) {
      set $host_without_www $1;
      }
      if ( $request ~ '/members' ) {
        rewrite ^(.*)$ http://member.$host_without_www/ permanent;
      }

}