中国青年报
com; ssl_certificate /path/to/yourd🍀omain
Apache服务器配置示例 在Apache的虚拟主机配置文件中启用mod_ssl模块,并添加: SSLEngine on SSLC🎉ertificateFile /path/to/yourdomain
key SSLCert🎯ificateChainFile /path/to/ca-bundle
crt —— ⭐主证书🎉文件 ca-bundle
crt SSLCerti🚀ficateKeyFile /path/to/yourdomain
第一步:生成证书签名请求(CSR) 在服务器上使用命令行工具生成私钥和CSR文件
crt; ssl_cert📢ificate_key /path/to/yo📌urdomain
也可以查看网页源代码,确认所有内部资源(图片、样式、脚本)均使用HTTPS协议,🎉避免混合内容警告
以OpenSSL💪为例,在Linux终端执行以下命令: openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain
csr 根据提示依次填写国家代码(如CN)、省/市、组织名🔑称、通用名称(即网站域名,例如 www
com; return 301 https://$server_name$request_uri; } 同时,在百度站🌈长平台提交HTTPS站点地图(Sitemap),并更新robots
crt; # 其他配置项如root、index等 } 保存后,使用 ngin🌟x -t 测试配置语法,确认无误后执行 sy❤️stemctl reload nginx 或 service nginx reload 使配置生效
建议在百度搜索资源平台中验证新增的HTTPS站点,并提交索引更新请⭐求,以加速百度爬虫识别新的安全链接