nginx安装之后添加SSL站点及常用模块介绍
来源:互联网 发布:旋律合成软件app 编辑:程序博客网 时间:2024/06/10 07:50
nginx安装成功之后,用到https的时候,发现安装的时候没有添加http_ssl_module。执行代码如下:
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
报错:
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using –with-openssl=< path> option.
解决方式:
yum -y install openssl openssl-devel
安装成功之后,重新执行上面的配置。然后执行make,把objs中新生产的nginx替换sbin中旧的nginx。这个时候执行nginx -s reload,没有起作用。干掉nginx,重新启动就OK了。
nginx.conf配置如下:
server { listen 443 ; server_name xx.xxx.com; ssl on; ssl_certificate sslkey/xx.xx.com.crt; #证书文件路径 ssl_certificate_key sslkey/xx.xx.com.key; #秘钥文件路径 ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_ignore_headers Set-Cookie Cache-Control; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_max_temp_file_size 0; proxy_connect_timeout 60; proxy_send_timeout 60; proxy_read_timeout 60; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; proxy_cookie_path / /dev/shm; proxy_pass http://127.0.0.1:8080; } }
nginx编译参数说明如下:
–without-select_module 如果在configure的时候没有发现kqueue, epoll, rtsig或/dev/poll其中之一,select模块始终为启用状态。 –with-poll_module
–without-poll_module 如果在configure的时候没有发现kqueue, epoll, rtsig或/dev/poll其中之一,poll模块始终为启用状态。 –with-http_ssl_module 启用ngx_http_ssl_module,启用SSL支持并且能够处理HTTPS请求。需要OpenSSL,在Debian系统中,对应的包为libssl-dev。 –with-http_realip_module 启用ngx_http_realip_module –with-http_addition_module 启用ngx_http_addition_module –with-http_sub_module 启用ngx_http_sub_module –with-http_dav_module 启用ngx_http_dav_module –with-http_flv_module 启用ngx_http_flv_module –with-http_stub_status_module 启用”server status”(服务状态)页 –without-http_charset_module 禁用ngx_http_charset_module –without-http_gzip_module 禁用ngx_http_gzip_module,如果启用,需要zlib包。 –without-http_ssi_module 禁用ngx_http_ssi_module –without-http_userid_module 禁用ngx_http_userid_module –without-http_access_module 禁用ngx_http_access_module –without-http_auth_basic_module 禁用ngx_http_auth_basic_module –without-http_autoindex_module 禁用ngx_http_autoindex_module –without-http_geo_module 禁用ngx_http_geo_module –without-http_map_module 禁用ngx_http_map_module –without-http_referer_module 禁用ngx_http_referer_module –without-http_rewrite_module 禁用ngx_http_rewrite_module。如果启用,需要PCRE包。 –without-http_proxy_module 禁用ngx_http_proxy_module –without-http_fastcgi_module 禁用ngx_http_fastcgi_module –without-http_memcached_module 禁用ngx_http_memcached_module –without-http_limit_zone_module 禁用ngx_http_limit_zone_module –without-http_empty_gif_module 禁用ngx_http_empty_gif_module –without-http_browser_module 禁用ngx_http_browser_module –without-http_upstream_ip_hash_module 禁用ngx_http_upstream_ip_hash_module –with-http_perl_module 启用ngx_http_perl_module –with-perl_modules_path=PATH 为perl模块设置路径 –with-perl=PATH 为perl库设置路径 –http-client-body-temp-path=PATH 为http连接的请求实体临时文件设置路径,如果没有指定,默认为< prefix >/client_body_temp –http-proxy-temp-path=PATH 为http代理临时文件设置路径,如果没有指定,默认为< prefix >/proxy_temp –http-fastcgi-temp-path=PATH 为http fastcgi临时文件设置路径,如果没有指定,默认为< prefix >/fastcgi_temp –without-http 禁用HTTP服务 –with-mail 启用IMAP4/POP3/SMTP代理模块 –with-mail_ssl_module 启用ngx_mail_ssl_module –with-cc=PATH 设置C编译器路径 –with-cpp=PATH 设置C预处理器路径 –with-cc-opt=OPTIONS 变量CFLAGS中附加的参数,用于FreeBSD中的PCRE库,同样需要指定–with-cc-opt=”-I /usr/local/include”,如果我们使用select()函数则需要同时增加文件描述符数量,可以通过–with-cc-opt=”-D FD_SETSIZE=2048”指定。 –with-ld-opt=OPTIONS 通过连接器的附加参数,用于FreeBSD中的PCRE库,同样需要指定–with-ld-opt=”-L /usr/local/lib”。 –with-cpu-opt=CPU 指定编译的CPU,可用的值为: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64 –without-pcre 禁用PCRE库文件,同时将禁用HTTP rewrite 模块,如果要在”location”指令中使用正则表达式,同样需要PCRE库。 –with-pcre=DIR 设置PCRE库源文件路径。 –with-pcre-opt=OPTIONS 在编译时为PCRE设置附加参数。 –with-md5=DIR 设置md5库源文件路径。 –with-md5-opt=OPTIONS 在编译时为md5设置附加参数。 –with-md5-asm 使用md5汇编源。 –with-sha1=DIR 设置sha1库源文件路径。 –with-sha1-opt=OPTIONS 在编译时为sha1设置附加参数。 –with-sha1-asm 使用sha1汇编源。 –with-zlib=DIR 设置zlib库源文件路径。 –with-zlib-opt=OPTIONS 在编译时为zlib设置附加参数。 –with-zlib-asm=CPU 为指定的CPU使用zlib汇编源进行优化,可用值为: pentium, pentiumpro。 –with-openssl=DIR 设置openssl库源文件路径。 –with-openssl-opt=OPTIONS 在编译时为openssl设置附加参数。 –with-debug 启用debug记录。 –add-module=PATH 增加一个在PATH中的第三方模块。
0 0
- nginx安装之后添加SSL站点及常用模块介绍
- nginx 安装ssl模块
- Nginx常用模块介绍及配置文件说明
- Nginx安装ssl模块和nginx_lua模块
- Linux下,Nginx的安装、升级及动态添加模块
- Nginx安装HTTP SSL模块基本配置
- ubunut,已经安装nginx,开启SSL模块
- 平滑升级Nginx,添加ssl以及echo模块
- Ansible的安装、配置及常用模块介绍
- nginx 安装ssl证书及域名配置文件
- nginx-ssl模块
- nginx中ssl模块
- nginx 平滑升级及ssl模块升级配置
- Nginx添加ssl证书
- nginx添加模块(非覆盖安装)
- 脚本安装Nginx并添加Naxsi模块
- nginx添加模块(非覆盖安装)
- Nginx添加模块(非覆盖安装)
- 剑指offer--包含min函数的栈
- 【BZOJ 2194】 快速傅立叶之二
- 中企故事汇:铁匠之乡借东风出海
- 基于MAVEN的SSM(SPRING,SPRINGMVC,MYBATIS)整合的WEB工程
- 微软编程题-把二元查找树变成排序的双向链表
- nginx安装之后添加SSL站点及常用模块介绍
- 欢迎使用CSDN-markdown编辑器
- mybatis generator只生成insert方法解决方案之一
- 中企故事汇:马可波罗三生三世的故事
- mysql 5.7.18 安装及问题汇总
- 如何降低Unity程序的Drawcall
- UI自动化执行遇到的问题汇总
- 笔记整理2
- 深入浅出node.js游戏服务器开发1——基础架构与框架介绍