{ 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;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容