1.将阿里云 下载下来的nginx(key/pem) 放在nignx包下面(重新创建一个文件夹/cer) expired:三月换一次
2.更新nignx config.conf 配置 配置如下:
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - time_local] “request" '
'status http_referer” ’
‘“http_x_forwarded_for”’;
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
server {
listen 443 ssl;
server_name www.wxapp.samlin.com.cn;
root /usr/share/nginx/html;
ssl_certificate cert/www.wxapp.samlin.com.cn.pem;
ssl_certificate_key cert/www.wxapp.samlin.com.cn.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_ciphers PROFILE=SYSTEM;
ssl_prefer_server_ciphers on;
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://www.wxapp.samlin.com.cn:8090/;
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_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 80;
server_name www.wxapp.samlin.com.cn;
# 重定向所有HTTP请求到HTTPS。
return 301 https://$host$request_uri;
}
}