美文网首页
{ nginx } Nginx Configuration

{ nginx } Nginx Configuration

作者: nealma | 来源:发表于2016-08-03 16:06 被阅读0次

    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

          本文链接:https://www.haomeiwen.com/subject/blgqsttx.html