Fork me on GitHub
瞬间的惊奇真是种确幸,每种确幸都是支玄妙的俳句。吊桥抬起,退回到内心幽静的花园,邂逅的还是那种熟悉的冷冷清清又轰轰烈烈的美妙质感。这真令人欢喜。

Nginx加载模块

1. /usr/local/nginx/sbin/nginx -V 查看nginx版本与编译安装了哪些模块
nginx version: nginx/1.10.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments:


2. 下载nginx 1.10.3, 并且configure(以前的编译选项也要加上)
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module


3. 执行make ,千万不要make install 否则会覆盖现有的nginx


4. 关闭nginx


5. copy ~/download/nginx-1.10.3/objs/nginx 到现有的/usr/local/nginx/sbin/nginx


6. /usr/local/nginx/sbin/nginx -V 查看编译安装的模块
nginx version: nginx/1.10.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

7. 修改nginx.conf文件
server {
server_name xxx.yyy.com;
listen 443;
ssl on;
ssl_certificate /usr/local/nginx/conf/xxx.com_server.txt; #公钥
ssl_certificate_key /usr/local/nginx/conf/xxx.com_private.txt; #私钥

location / {
# location的一堆配置
#
#
# ################
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
###########################80端口的处理###############################
server {
listen 80;
server_name xxx.yyy.com;
send_timeout 1800;

rewrite ^(.*)$ https://xxx.yyy.com$1 permanent; # 80端口跳转
}

 

ngx_http_auth_basic_module 模块实现让用户只有输入正确的用户名密码才允许访问web内容

posted @ 2018-10-01 10:08  干嘛那么贪睡  阅读(1041)  评论(0编辑  收藏  举报