nginx configure https ssl access


  The environment is centos 7.
 
First configure the certificate certificate compilation process. Omit the


  first step: install openssl
  (1) tar -xzvf ./openssl-1.0.1t.tar.gz
     cd openssl-1.0.1t/
    ./config --prefix=/usr /local/ssl --openssldir=/usr/local/ssl

     make && make install


     # View the installation version
     [root@localhost openssl]# openssl version -a The

second step is to compile and install nginx .
      Unzip nginx
      and execute the installation:
      ./configure --prefix =/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-openssl=/usr/local/openssl

      got error:
      /bin/sh: line 2: ./config: No such file or directory
make [1]: *** [/usr/local/ssl/.openssl/include/openssl/ssl.h] Error 127
make[1]: Leaving directory `/usr/local/src/nginx-1.9.9'
make: *** [build] Error 2


  Solution:
Open /usr/local/src/nginx-1.9 under the nginx source file .9/auto/lib/openssl/conf file:
found such a piece of code:
CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS ="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
Change to the following code:
CORE_INCS="$ CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
Then compile and install Nginx.


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326348896&siteId=291194637