nginx 配置443 域名

1 申请域名 (公有云)
2 下载证书 pem key 并上传服务器指定目录
3 公有云上做A记录解析 (解析到代理的nginx)
4 nginx配置443模块

配置内容:

server {
listen 80;
server_name softwaretest.ysjwproduction.com;
rewrite ^(.*)$ https://$host$1 permanent;
}

 

server {
listen 443 ssl;
server_name softretest.ysjwproduction.com;
ssl_certificate /opt/cert/9093999_softretest.ysjwproduction.com.pem;
ssl_certificate_key /opt/cert/9093999_softretest.ysjwproduction.com.key;

ssl_session_cache shared:SSL:1m;
ssl_session_timeout 120m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;

# ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

location / {
proxy_pass http://127.0.0.1:8083;
proxy_set_header WL-Proxy-Client-IP $remote_addr;
# proxy_redirect default;
# root html;
# index index.html index.htm;
}
}

 

 



5 重启nginx 并访问

 

posted @ 2023-01-09 15:05  铜锣湾扛把子·66  阅读(712)  评论(0)    收藏  举报