问题遇到的现象和发生背景
nginx 配置 域名后不生效
问题相关代码,请勿粘贴截图
server {
nginx 配置 域名后不生效
server {
server {
listen 443 ssl;
server_tokens off;
keepalive_timeout 5;
root /usr/share/nginx/html; #填写您的网站根目录,例如:/usr/local/lighthouse/softwares/wordpress
index index.html;
server_name xiaoyulife.cn; #填写您的证书绑定的域名,例如:www.cloud.tencent.com
ssl_certificate /etc/nginx/ssl/xiaoyulife.cn_bundle.crt; #填写您的证书文件名称,例如:1_cloud.tencent.com_bundle.crt
ssl_certificate_key /etc/nginx/ssl/xiaoyulife.cn.key; #填写您的私钥文件名称,例如:2_cloud.tencent.com.key
ssl_session_cache shared:SSL:1024m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 可参考此 SSL 协议进行配置
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; #可按照此加密套件配置,写法遵循 openssl 标准
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:8000;
}
#location /static {
# root /usr/share/nginx/html/;
#}
#location /media {
# root /usr/share/nginx/html/;
#}
}