标签:index.php 目的 ble led 证书 note aliyun 免费 mic
具体流程阿里云有文档
下面是我的conf配置文件
server { listen 443 ssl http2; #listen [::]:443 ssl http2; server_name yeves.cn www.yeves.cn; index index.html index.htm index.php default.html default.htm default.php; root /www/yeves; ssl on; ssl_certificate /usr/local/nginx/cert/a.pem; ssl_certificate_key /usr/local/nginx/cert/a.key; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } include enable-php.conf; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location /{ try_files $uri $uri/ /index.php?$uri&$args; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log /tmp/yeves.log; } server { listen 80; server_name yeves.cn www.yeves.cn; return 301 https://www.yeves.cn$request_uri; }
目的:https方式访问网站
解决步骤:
1,首先得确保http访问该网站是没问题的。
2,配置nginx.conf监听443端口,443是ssl默认的端口
a,nginx.conf这个文件所在路径:/www/server/nginx/conf/nginx.conf(因为我是用宝塔面板安装的nginxa跟不用宝塔面板安装的路径会有所不同)
b,nginx.conf中http模块里的server模块是用来配置虚拟主机的,我们的ssl配置就要再server模块里完成,因为宝塔面板在创建网站的时候,就将每个虚拟主机的conf单独写出来了,然后在nginx.conf里include这些单独的conf。形如:include /www/server/panel/vhost/nginx/*.conf;
c,需要修改你想要配置https的虚拟主机的conf文件,形如(需增加的配置):
server
{
listen 443 ssl;
server_name www.xxxxx.cn;这个域名必须是你申请ssl证书的时候绑定的域名
ssl on;
ssl_certificate /www/server/panel/vhost/cert/1682997_www.fancy56.cn.pem; #SSL 证书文件路径,由证书签发机构提供
ssl_certificate_key /www/server/panel/vhost/cert/1682997_www.fancy56.cn.key; #SSL 密钥文件路径,由证书签发机构提供
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
}
3,到云服务器的控制台,添加安全组规则,增加443端口
4,云服务器的防火墙开启443端口
firewall-cmd --zone=public --add-port=443/tcp --permanent 增加443端口
firewall-cmd --reload 重启防火墙
以上就是我在配置ssl的时候遇到的一些问题解决方式。
阿里云文档:
https://help.aliyun.com/knowledge_detail/95491.html?spm=5176.2020520154.cas.25.1abbF170F170Ll
标签:index.php 目的 ble led 证书 note aliyun 免费 mic
原文地址:https://www.cnblogs.com/php-linux/p/10667178.html