[root]# wget http://nginx.org/download/nginx-1.12.0.tar.gz [root]# tar zxvf nginx-1.12.0.tar.gz [root]# cd nginx-1.12.0 [root]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module \ --with-openssl=./openssl-1.0.1e \ --with-openssl-opt="enable-tlsext"
[root]# wget https://nchc.dl.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz [root]# tar zxvf pcre-8.35 [root]# yum -y install gcc [root]# yum -y install gcc-c++ [root]# yum install -y zlib-devel [root]# ./configure --prefix=/usr/local/nginx --with-http_ssl_module \ --with-openssl=./openssl-1.0.1e \ --with-openssl-opt="enable-tlsext" \ --with-pcre=./pcre-8.35
...
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name abc.com;
root /usr/share/nginx/html;
ssl_certificate "/root/keys/abc.com.pem";
ssl_certificate_key "/root/keys/abc.com.private.pem";
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name def.com;
root /usr/share/nginx/html;
ssl_certificate "/root/keys/def.com.pem";
ssl_certificate_key "/root/keys/def.com.private.pem";
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
[root]# yum install -y epel-releasesudo [root]# yum install -y certbot
server {
listen 80 default_server;
...
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /usr/share/nginx/html;
}
location = /.well-known/acme-challenge/ {
return 404;
}
}
[root]# certbot certonly --webroot -w /usr/share/nginx/html/ -d your.domain.com
|-- fullchain.pem |-- privkey.pem
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name def.com;
root /usr/share/nginx/html;
ssl_certificate "/etc/letsencrypt/live/your.domain.com/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/your.domain.com/privkey.pem";
include /etc/nginx/default.d/*.conf;
location / {
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
certbot renew --dry-run
[root]# crontab -e 30 2 * * 1 /usr/bin/certbot renew >> /var/log/le-renew.log
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有