{ nginx } Nginx Configuration

download nginx

1.8.0

download openssl

1.0.2f

install

cd nginx_home
./configure --prefix=/usr/local/nginx \
            --with-http_ssl_module \
            --with-openssl=/opt/openssl-1.0.2d \
            --with-openssl-opt="enable-tlsext"
make && make install

Multiple Host

server  {
        listen 443;
        server_name   www.nealma.com;
        index index.html index.htm index.php;
        root  /data/wwwroot/www.nealma.com/webroot;
        ssl on;
        ssl_certificate "/usr/local/nginx/conf/ssl/www.nealma.com.public.cer";
        ssl_certificate_key "/usr/local/nginx/conf/ssl/www.nealma.com.private.key";
 ......
}

server  {
        listen 443;
        server_name   www.malingyi.com;
        index index.html index.htm index.php;
        root  /data/wwwroot/www.malingyi.com/webroot;
        ssl on;
        ssl_certificate       "/usr/local/nginx/conf/ssl/www.malingyi.com.public.cer";
        ssl_certificate_key "/usr/local/nginx/conf/ssl/www.malingyi.com.private.key";
 ......
}

可能会出现的问题

  • 新的服务器缺少pcre
yum -y install pcre-devel
  • ngnix 配置缺少
server_names_hash_bucket_size 32;

你可能感兴趣的:({ nginx } Nginx Configuration)